30% OFF - 10th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY10
Entity Framework Relationships Discover which relation is supported
In the context of relational databases, a relationship exists between two relational database tables when one table has a foreign key that references the primary key of the other table. In Entity Framework, a relationship defines how two entities relate to each other.
Entity framework supports three types of relationships.
One-to-One Relationship
- In a one-to-one relationship, each row of data in one table is linked to zero or one row in the second table.
- For example, the
Author
andAuthorBiography
have a one-to-one relationship.
Read more about One-to-One Relationship
One-to-Many Relationship
- In a one-to-many relationship, each row of data in one table is linked to one or more rows in the second table.
- For example, the
Author
andBook
have a one-to-many relationship.
Read more about One-to-Many Relationship
Many-to-Many Relationship
- In a many-to-many relationship, each row of data in one table is linked to many rows in the second table and vice versa.
- For example, the
Book
andCategory
have a many-to-many relationship that is defined by one-to-many relationship from each of these tables to theBookCategory
table.
Read more about Many-to-Many Relationship
ZZZ Projects