AssociationSet.Create Method (String, AssociationType, EntitySet, EntitySet, IEnumerable<MetadataProperty>)
Creates a read-only AssociationSet instance from the specified parameters.
Assembly: EntityFramework (in EntityFramework.dll)
public static AssociationSet Create( string name, AssociationType type, EntitySet sourceSet, EntitySet targetSet, IEnumerable<MetadataProperty> metadataProperties )
Parameters
- name
-
Type:
System.String
The name of the association set.
- type
-
Type:
System.Data.Entity.Core.Metadata.Edm.AssociationType
The association type of the elements in the association set.
- sourceSet
-
Type:
System.Data.Entity.Core.Metadata.Edm.EntitySet
The entity set for the source association set end.
- targetSet
-
Type:
System.Data.Entity.Core.Metadata.Edm.EntitySet
The entity set for the target association set end.
- metadataProperties
-
Type:
System.Collections.Generic.IEnumerable<MetadataProperty>
Metadata properties to be associated with the instance.
Return Value
Type: System.Data.Entity.Core.Metadata.Edm.AssociationSetThe newly created AssociationSet instance.
Exception | Condition |
---|---|
ArgumentException | The specified name is null or empty. |
ArgumentNullException | The specified association type is null. |
ArgumentException | The entity type of one of the ends of the specified association type does not match the entity type of the corresponding entity set end. |