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
Well done!
You have completed Entity Framework with ASP.NET MVC!
You have completed Entity Framework with ASP.NET MVC!
Now let's add the ASP.NET MVC project to our solution and add the starter files for our 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/v1.4 -b adding-the-aspnet-mvc-project
ASP.NET MVC Project Starter Files
The starter files for the Comic Book Library Manager web app are available at http://treehouse-project-downloads.s3.amazonaws.com/dotnet-ef-with-aspnet-mvc-comic-book-library-manager.zip.
Code
Here's the code for the AddArtist
method that needs to be added to the ComicBook entity class.
/// <summary>
/// Adds an artist to the comic book.
/// </summary>
/// <param name="artistId">The artist ID to add.</param>
/// <param name="roleId">The role ID that the artist had on this comic book.</param>
public void AddArtist(int artistId, int roleId)
{
Artists.Add(new ComicBookArtist()
{
ArtistId = artistId,
RoleId = roleId
});
}
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