/// <summary> /// Initializes a new instance of the <see cref="T:System.Object" /> class. /// </summary> public EntityRelationship(EntityRelationSide from, EntityRelationSide to, bool willCascadeOnDelete, EntityInfo manyToManyTable = null) { From = from; To = to; WillCascadeOnDelete = willCascadeOnDelete; ManyToManyTable = manyToManyTable; }
private static void AddNavPropertyToEntity(EntityRelationSide side) { if (side.IsUndirect) { return; } side.Entity.NavigationProperties.Add(side.Property); if (side.NavigationType != NavigationType.Many) { side.Entity.AddProperty(new PropertyInfo(string.Format("Has{0}", side.Property.Name), typeof(bool).ToUsageInfo(), new PropertyInvokerInfo(string.Format("return !ReferenceEquals({0}, null);", side.Property.Name)))); } }