MetadataWorkspaceExtensions.GetDependentEnd Method
Returns the dependent end of the specified AssociationType object.
Namespace: Microsoft.Data.Entity.Design.DatabaseGeneration
Assembly: Microsoft.Data.Entity.Design.DatabaseGeneration (in Microsoft.Data.Entity.Design.DatabaseGeneration.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function GetDependentEnd ( _
association As AssociationType _
) As AssociationEndMember
'Usage
Dim association As AssociationType
Dim returnValue As AssociationEndMember
returnValue = association.GetDependentEnd()
public static AssociationEndMember GetDependentEnd(
this AssociationType association
)
[ExtensionAttribute]
public:
static AssociationEndMember^ GetDependentEnd(
AssociationType^ association
)
public static function GetDependentEnd(
association : AssociationType
) : AssociationEndMember
Parameters
- association
Type: System.Data.Metadata.Edm.AssociationType
An association in a conceptual model.
Return Value
Type: System.Data.Metadata.Edm.AssociationEndMember
The dependent end of the specified AssociationType object.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type AssociationType. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
The GetDependentEnd() method applies the following rules (in order of priority) when returning the dependent end of an AssociationType object:
If a referential constraint is defined on the association, the dependent end (as specified by the referential constraint) is returned.
If the multiplicity of the association is one-to-one (1:1) and OnDelete="Cascade" is defined on one association end, then the other association end is returned. If OnDelete="Cascade" is not defined on either end, then the first element in the AssociationEndMembers property of the association parameter is returned.
If the multiplicity of an association is one-to-many (1:*) or zero-or-one-to-many (0..1:*) the association end with multiplicity of many (*) is returned.
In an association with multiplicity of zero-or-one-to-one (0..1:1), the association end with multiplicity of zero-or-one (0..1) is returned.
The GetDependentEnd() method is used by the Generate Database Wizard when generating a database from a conceptual model.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
MetadataWorkspaceExtensions Class
MetadataWorkspaceExtensions Members
Microsoft.Data.Entity.Design.DatabaseGeneration Namespace
Other Resources
How to: Generate a Database from a Conceptual Model (Entity Data Model Tools)