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
- Adding a One-to-Many Entity Relationship 5:48
- Using a One-to-Many Relationship 8:35
- Defining a Foreign Key Property 2:59
- Defining and Using a One-to-Many Relationship 2 objectives
- Adding a Many-to-Many Relationship 10:33
- Defining a Many-to-Many Relationship 2 objectives
- Defining a Many-to-Many Relationship with an Explicit Bridge Entity 10:25
- Defining a Many-to-Many Relationship with an Explicit Bridge Entity 3 objectives
- Using Data Annotations to Refine the Generated Database 5:58
- Refining a Model Using Data Annotations 1 objective
- Overriding the Context's OnModelCreating Method 6:33
- Using the Fluent API 1 objective
- Populating Your Database with Seed Data 5:55
- Section Review 10 questions

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Our model allows us to associate artists with comic books, but our current approach doesn't allow us to specify the role that the artist had. To do that, let's move from an "implicit" bridge table to an "explicit" one, by adding an entity class to our model for the bridge table.
Follow Along
To follow along commiting your changes to this course, you'll need to fork the dotnet-comic-book-gallery-model repo. Then you can clone, commit, and push your changes to your fork like this:
git clone <your-fork>
cd dotnet-comic-book-gallery-model
git checkout tags/v3.5 -b defining-many-to-many-relationship-with-an-explicit-bridge-entity
Additional Learning
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Hakim Rachidi
38,490 Points1 Answer
-
PLUS
Chan Nyein Aung
Courses Plus Student 2,833 Points1 Answer
-
Joel Brennan
18,300 PointsAn unhandled exception of type 'System.InvalidOperationException' occurred in EntityFramework.SqlServer.dll
Posted by Joel BrennanJoel Brennan
18,300 Points2 Answers
-
Will Anderson
28,683 Points1 Answer
-
Jannung Kusdiantoro
6,743 Points4 Answers
View all discussions for this video
Related 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