In this video, learn how to pull a set of resources from the database and return them to the client as a collection.
- [Narrator] Let's implement the get rooms route…on the rooms controller.…I'm gonna rename this method to get all rooms,…just to be a little bit more clear about what it does.…I used control RR in visual studio to rename it.…Since we know this is gonna produce a 200 OK,…we can add produces response type 200,…and I need to make this async now.…This will return a task of action results.…
The actual response type is gonna be collection of room.…Inside this method, we'll call a new service method…that we need to write, say var rooms await the room service,…get all, or say get rooms, async,…we'll need to write that method.…Then we'll just build up a collection response.…We'll say var collection equals new collection of room.…The self link will be a link dot to just this method,…get all rooms.…
And the value's gonna be what we get back…from the room service get rooms async,…just dot rooms dot to array.…The very end here, we need to return this collection.…All right, we have some changes…we need to make to the interface.…
- What is RESTful design?
- Building a new API with ASP.NET Core
- Using HTTP methods
- Returning JSON
- Creating RESTful routing with templates
- Securing RESTful APIs with HTTPS
- Representing resources
- Representing links
- Representing collections
- Sorting and searching collections
- Building forms
- Adding caching to an ASP.NET Core API
- Configuring user authentication and authorization
Skill Level Advanced
1. REST API Concepts
2. Build a Basic API
3. Versioning and Errors
4. Secure the API
5. Represent Resources
6. Represent Links
7. Represent Collections
Add pagination7m 37s
8. Sorting Collections
9. Searching Collections
10. Forms and Modifying Data
11. Caching and Compression
12. Authentication and Authorization
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.