This course will be retired on July 14, 2025.
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 "Artists" 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.2 -b exercise-finishing-the-artists-section
Exercise
To finish the exercise, complete the following tasks:
ComicBookLibraryManagerWebApp/Controllers/ArtistsController.cs File
- Update the controller class to inherit from the BaseController class.
Index
Action Method
- Write a query that retrieves a list of artists.
Detail
Action Method
- Write a query that retrieves a single artist with the
ComicBooks
,ComicBooks.ComicBook
,ComicBooks.ComicBook.Series
, andComicBooks.Role
navigation properties eagerly loaded. Use the action method'sid
parameter to determine which artist to retrieve.
Add
POST Action Method
- Handle adding the artist entity to the database.
Edit
GET Action Method
- Write a query to retrieve a single artist (same as the query for the
Detail
action method).
Edit
POST Action Method
- Handle updating the artist entity in the database.
Delete
GET Action Method
- Write a query to retrieve a single artist (same as the query for the
Detail
andEdit
GET action methods).
Delete
POST Action Method
- Handle deleting the artist entity from the database.
ValidateArtist
Method
- Write a query that checks for the existence of an artist entity that has the same
Name
property value as the passed entity.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up