Join Jess Chadwick for an in-depth discussion in this video Solution, part of Learning ASP.NET Core MVC.
- [Instructor] Let me show you…how I implemented this challenge.…First, I took the get API…that allows consumers…to retrieve a single comment by its ID.…The first thing I did…was to change the return type of the action…because the action should return a comment, not a string.…Then I changed the int parameter to a long,…to match the type of the ID property on the comment class.…And finally, the good stuff.…I found the comment that matches this ID…in the comments collection.…
Next, I'll skip the put method for a minute…and I'll jump to delete…because it's very similar to this one.…While I will leave the return type as void,…I'll change the int parameter to a long parameter…to match the comment class again.…Then I'll use the same code as before…to locate the comment by its ID.…If I find the comment,…I'll remove it from the database…by simply removing it from the collection.…And don't forget to run save changes when you're done.…And finally, we'll get back to the put method.…The important thing here is really just remembering…
- Building blocks of ASP.NET Core applications
- Creating a new project
- Responding to HTTP requests
- Serving static files
- Understanding the MVC pattern
- Handling requests with controllers
- Rendering HTML with Razor
- Rendering data, view markup, and view logic
- Creating HTML forms
- Validating form data
- Reading and writing from a database with Entity Framework
- Improving the user experience
- Exposing data with a web API
- Securing your ASP.NET application
Skill Level Intermediate
1. The Basics
2. The Model-View-Controller (MVC) Pattern
Understand routing4m 24s
3. Render HTML with Views
4. Work with Data
5. Improve User Experience with Ajax and Web APIs
6. Secure Your Application
Next steps1m 42s
- 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.