public static void AddColumn(this EntityType table, EdmProperty column) { DebugCheck.NotNull(table); DebugCheck.NotNull(column); column.SetPreferredName(column.Name); column.Name = table.Properties.UniquifyName(column.Name); table.AddMember(column); }
public static EdmProperty AddComplexProperty( this ComplexType complexType, string name, ComplexType targetComplexType) { DebugCheck.NotNull(complexType); DebugCheck.NotNull(complexType.Properties); DebugCheck.NotEmpty(name); DebugCheck.NotNull(targetComplexType); var property = EdmProperty.CreateComplex(name, targetComplexType); complexType.AddMember(property); return property; }
public static NavigationProperty AddNavigationProperty( this EntityType entityType, string name, AssociationType associationType) { DebugCheck.NotNull(entityType); DebugCheck.NotEmpty(name); DebugCheck.NotNull(associationType); var targetEntityType = associationType.TargetEnd.GetEntityType(); var typeUsage = associationType.TargetEnd.RelationshipMultiplicity.IsMany() ? (EdmType)targetEntityType.GetCollectionType() : targetEntityType; var navigationProperty = new NavigationProperty(name, TypeUsage.Create(typeUsage)) { RelationshipType = associationType, FromEndMember = associationType.SourceEnd, ToEndMember = associationType.TargetEnd }; entityType.AddMember(navigationProperty); return navigationProperty; }
public static EdmProperty AddComplexProperty( this EntityType entityType, string name, ComplexType complexType) { DebugCheck.NotNull(entityType); DebugCheck.NotEmpty(name); DebugCheck.NotNull(complexType); var property = EdmProperty.CreateComplex(name, complexType); entityType.AddMember(property); return property; }