AssociationType.Create Method (String, String, Boolean, DataSpace, AssociationEndMember, AssociationEndMember, ReferentialConstraint, IEnumerable<MetadataProperty>)

 

Creates a read-only AssociationType instance from the specified parameters.

Namespace:   System.Data.Entity.Core.Metadata.Edm
Assembly:  EntityFramework (in EntityFramework.dll)

public static AssociationType Create(
	string name,
	string namespaceName,
	bool foreignKey,
	DataSpace dataSpace,
	AssociationEndMember sourceEnd,
	AssociationEndMember targetEnd,
	ReferentialConstraint constraint,
	IEnumerable<MetadataProperty> metadataProperties
)

Parameters

name
Type: System.String

The name of the association type.

namespaceName
Type: System.String

The namespace of the association type.

foreignKey
Type: System.Boolean

Flag that indicates a foreign key (FK) relationship.

dataSpace
Type: System.Data.Entity.Core.Metadata.Edm.DataSpace

The data space for the association type.

sourceEnd
Type: System.Data.Entity.Core.Metadata.Edm.AssociationEndMember

The source association end member.

targetEnd
Type: System.Data.Entity.Core.Metadata.Edm.AssociationEndMember

The target association end member.

constraint
Type: System.Data.Entity.Core.Metadata.Edm.ReferentialConstraint

A referential constraint.

metadataProperties
Type: System.Collections.Generic.IEnumerable<MetadataProperty>

Metadata properties to be associated with the instance.

Return Value

Type: System.Data.Entity.Core.Metadata.Edm.AssociationType

The newly created AssociationType instance.

Exception Condition
ArgumentException

The specified name is null or empty.

ArgumentException

The specified namespace is null or empty.