private void DeferOwnerDetection(ModelType type, EntityReferenceProperty property, NavigationProperty oneNavProp) { type.AfterInitialize(delegate { var parentReference = property.PropertyType.Properties[oneNavProp.Name]; if (parentReference != null && ( (oneNavProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.One && oneNavProp.ToEndMember.TypeUsage.Facets.Any(f => f.Name == "Nullable" && !(bool)f.Value)) || (oneNavProp.FromEndMember.RelationshipMultiplicity == RelationshipMultiplicity.One && oneNavProp.FromEndMember.TypeUsage.Facets.Any(f => f.Name == "Nullable" && !(bool)f.Value)))) { ((EntityModelType)type).OwnerProperties[property] = parentReference as ModelReferenceProperty; } }); }
private void DeferOwnerDetection(ModelType type, EntityReferenceProperty property, NavigationProperty oneNavProp) { type.AfterInitialize(delegate { var parentReference = property.PropertyType.Properties[oneNavProp.Name]; if (parentReference != null && ( (oneNavProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.One && oneNavProp.ToEndMember.TypeUsage.Facets.Any(f => f.Name == "Nullable" && !(bool)f.Value)) || (oneNavProp.FromEndMember.RelationshipMultiplicity == RelationshipMultiplicity.One && oneNavProp.FromEndMember.TypeUsage.Facets.Any(f => f.Name == "Nullable" && !(bool)f.Value)))) ((EntityModelType) type).OwnerProperties[property] = parentReference as ModelReferenceProperty; }); }