EF Core
Getting started with EF Core
Getting started with EF Core
  • Introduction
    • What is an ORM
    • Entity Framework Core
    • EF Core architecture
    • EF Core Approaches
  • Basics of EF Core
    • Create the project
      • Create the model & context
    • Create migration
    • CRUD using EF
      • Creating many entities
      • Update & Delete
    • Adding a property
      • Add migration
  • Entity Relationships
    • Add related entity
      • Add Vehicle
      • Modify Student
      • Modify context
      • Add migration
    • Manipulate related data
  • Entity Configuration
    • Fluent APIs
      • Frequently used APIs
    • Data Annotations
      • Frequently used annotations
Powered by GitBook
On this page
  • Relationships
  • Definition of terms
  1. Entity Relationships

Add related entity

Relationships

A relationship defines how two entities relate to each other. In a relational database, this is represented by a foreign key constraint.

Definition of terms

There are a number of terms used to describe relationships

  • Dependent entity: This is the entity that contains the foreign key properties. Sometimes referred to as the 'child' of the relationship.

  • Principal entity: This is the entity that contains the primary/alternate key properties. Sometimes referred to as the 'parent' of the relationship.

  • Principal key: The properties that uniquely identify the principal entity. This may be the primary key or an alternate key.

  • Foreign key: The properties in the dependent entity that are used to store the principal key values for the related entity.

  • Navigation property: A property defined on the principal and/or dependent entity that references the related entity.

    • Collection navigation property: A navigation property that contains references to many related entities.

    • Reference navigation property: A navigation property that holds a reference to a single related entity

PreviousAdd migrationNextAdd Vehicle

Last updated 2 years ago