16.0: Http Methods
Add IHttpActionResult
for all CRUD Endpoints
IHttpActionResult
for all CRUD EndpointsOpen ElevenNote.WebAPI -> Controllers -> NoteController
Rename the
Get()
method toGetAll()
to distinguish getting all the notes from getting just one note.See below for stubbing out the other
IHttpActionResults
forGet
,Post
,Put
, andDelete
CTRL .
To bring in the using statement for the models. If you are using your own application, be sure to use the appropriate models from the .Models project, not the .Data assembly.
Get Method
Finish out the Get(int id)
method:
Post Method
Finish out the Post(NoteCreate note)
method:
Put Method
Finish out the Put(NoteEdit note)
Method:
Delete Method
Finish out the Delete(int id)
method:
Next, we'll look at the API docs and test the endpoints.
Last updated