In entity framework.. when you apply an association in fluent mapping in one side of the association does both sides of the association get automatically generated by EF ?
If you take as example an OneToMany relationship. If i apply the association between X and Y in the fluent mapping configuration of X does this also apply at the Y side ? Will i be able to access X on the Y entity using a navigation property ?
Does Y will be able to access X and vise versa.
Thanks.
Yes. You configure actually a one-to-many relationship with Fluent API, not a property on one of the entities or any “access” rules of the navigation properties. If you have navigation properties on both sides of the relationship, you can configure the relationship for entity X or Y. It doesn’t matter which one and you need to do it only for one, not for both. If you have only one navigation property exposed in an entity, say X, you must configure the relationship for entity X.