What are the Navigation Properties in Entity Framework

后端 未结 3 1766
刺人心
刺人心 2021-02-20 11:29

I am new to Entity Framework. When the Visual Studio creates Model diagram we can see mainly two things in Entities.Propertie and Navigation Properties,So what are these Navigat

3条回答
  •  被撕碎了的回忆
    2021-02-20 12:27

    Navigation properties in the Entity Framework provide a way to navigate an association between two entity types. Every object can have a navigation property for every relationship in which it participates. Navigation properties allow you to navigate and manage relationships in both directions, returning either an EntityReference, if the multiplicity is either one or zero-or-one, or an EntityCollection, if the multiplicity is many.

    When you use the Entity Framework-generated classes, navigation properties are created for objects that participate in a relationship.

    UPDATE: Here is nice navigation properties example for relations between books, authors and publishers.

提交回复
热议问题