Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Let's take a look at your next exercise: finishing the "Series" section of the web app.
Follow Along
To follow along committing your changes to this course, you'll need to fork the dotnet-comic-book-library-manager repo. Then you can clone, commit, and push your changes to your fork like this:
git clone <your-fork>
cd dotnet-comic-book-library-manager
git checkout tags/v4.1 -b exercise-finishing-the-series-section
Exercise
To finish the exercise, complete the following tasks:
ComicBookLibraryManagerWebApp/Controllers/SeriesController.cs File
- Update the controller class to inherit from the BaseController class.
Index
Action Method
- Write a query that retrieves a list of series.
Detail
Action Method
- Write a query that retrieves a single series with the
ComicBooks
navigation property eagerly loaded. Use the action method'sid
parameter to determine which series to retrieve.
Add
POST Action Method
- Handle adding the series entity to the database.
Edit
GET Action Method
- Write a query to retrieve a single series (same as the query for the
Detail
action method).
Edit
POST Action Method
- Handle updating the series entity in the database.
Delete
GET Action Method
- Write a query to retrieve a single series (same as the query for the
Detail
andEdit
GET action methods).
Delete
POST Action Method
- Handle deleting the series entity from the database.
ValidateSeries
Method
- Write a query that checks for the existence of a series entity that has the same
Title
property value as the passed entity.
You need to sign up for Treehouse in order to download course files.
Sign up