We have determined that if you have two entities that are related and then you leave the default navigation properties between them (one pointing to the other and back), then saving Entity data is not possible. Only one navigation property can be kept.
For example:
ENTITY:USER
Property.UserId
NavigationProperty.Favorites
_
ENTITY:FAVORITE
Property.FavoriteId
Property.URL
Property.UserFk
NavigationProperty.Users
Does anyone know of an easy way to detect these circular navigati开发者_如何转开发on properties? I know one way is to look for them by hand - we're doing that, but we have hundreds of entities in our EDMX and "manual" approach is proving to not be a realiable option.
Thanks.
We have determined that if you have two entities that are related and then you leave the default navigation properties between them (one pointing to the other and back), then saving Entity data is not possible. Only one navigation property can be kept.
You have determined it wrong - saving entities works without any problem. The only scenario where this cause problems is serialization where it can be solved for some serializers with additional metadata.
精彩评论