Share via


MetadataWorkspaceExtensions.GetDependentProperty Method

Returns the property on the dependent end of the specified referential constraint that corresponds to the property on the principal end.

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 GetDependentProperty ( _
    property As EdmProperty, _
    refConstraint As ReferentialConstraint _
) As EdmProperty
'Usage
Dim property As EdmProperty
Dim refConstraint As ReferentialConstraint
Dim returnValue As EdmProperty

returnValue = property.GetDependentProperty(refConstraint)
public static EdmProperty GetDependentProperty(
    this EdmProperty property,
    ReferentialConstraint refConstraint
)
[ExtensionAttribute]
public:
static EdmProperty^ GetDependentProperty(
    EdmProperty^ property, 
    ReferentialConstraint^ refConstraint
)
public static function GetDependentProperty(
    property : EdmProperty, 
    refConstraint : ReferentialConstraint
) : EdmProperty

Parameters

Return Value

Type: System.Data.Metadata.Edm.EdmProperty
The property on the dependent end of the specified referential constraint that corresponds to the property on the principal end.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type EdmProperty. 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 GetDependentProperty() method is used by the Generate Database Wizard when generating a database from a conceptual model.

Examples

Consider the following referential constraint that is defined in a conceptual model:

<ReferentialConstraint>
     <Principal Role="DiscontinuedProduct">
          <PropertyRef Name="ProductId" />
          <PropertyRef Name="ProductName" />
     </Principal>
     <Dependent Role="DiscontinuedItem">
          <PropertyRef Name="ItemId" />
          <PropertyRef Name="ItemName" />
     </Dependent>
</ReferentialConstraint>

If the ProductName property were passed to the GetDependentProperty() method, the ItemName property would be returned.

Permissions

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)

Windows Workflow Foundation