EF4 Code First: how to add a relationship without adding a navigation property

后端 未结 3 566
有刺的猬
有刺的猬 2020-11-27 20:41

How should I define relationships using Code First but without using any navigation properties?

Previously I have defined One-Many and Many-Many by using navigation

3条回答
  •  悲哀的现实
    2020-11-27 20:57

    You can use the fluent api to add the relationship, though the "configuration" code is separate from the entity code making it less discoverable.

提交回复
热议问题