private static Type CreateRelationType(Type entityType, EntityRelationCardinality cardinality) { switch (cardinality) { case EntityRelationCardinality.One: case EntityRelationCardinality.OptionalOne: return(entityType); case EntityRelationCardinality.Many: return(typeof(ICollection <>).MakeGenericType(entityType)); default: throw new ArgumentOutOfRangeException(nameof(cardinality)); } }
private static EdmMultiplicity Convert(EntityRelationCardinality cardinality) { switch (cardinality) { case EntityRelationCardinality.One: return(EdmMultiplicity.One); case EntityRelationCardinality.OptionalOne: return(EdmMultiplicity.ZeroOrOne); case EntityRelationCardinality.Many: return(EdmMultiplicity.Many); default: throw new ArgumentOutOfRangeException(nameof(cardinality)); } }
public EntityRelationCardinalityFeature(EntityRelationCardinality cardinality, EntityElement target) { Cardinality = cardinality; Target = target; }
private static EdmMultiplicity Convert(EntityRelationCardinality cardinality) { switch (cardinality) { case EntityRelationCardinality.One: return EdmMultiplicity.One; case EntityRelationCardinality.OptionalOne: return EdmMultiplicity.ZeroOrOne; case EntityRelationCardinality.Many: return EdmMultiplicity.Many; default: throw new ArgumentOutOfRangeException("cardinality"); } }
private static Type CreateRelationType(Type entityType, EntityRelationCardinality cardinality) { switch (cardinality) { case EntityRelationCardinality.One: case EntityRelationCardinality.OptionalOne: return entityType; case EntityRelationCardinality.Many: return typeof(ICollection<>).MakeGenericType(entityType); default: throw new ArgumentOutOfRangeException(nameof(cardinality)); } }