Share via


AssociationEnd (EntityTypeMapping)

As a child element of an AssociationSetMapping element in the Entity Data Model (EDM), the AssociationEnd element in a ModificationFunctionMapping element specifies an Association that must be updated, along with changes to entities that are modified by stored procedures.

To specify the Association to be updated, the AssociationEnd element uses the following attributes and child elements:

  • The AssociationSet attribute identifies the Association that must be updated.

  • The From and To attributes specify the ends of the Association.

  • The ScalarProperty element maps the key property of the entity that the From attribute specifies to ParameterName in the stored procedure that is being mapped.

Example

In the following example, the AssociationEnd element is a child element of an UpdateFunction element. In addition to being a child element to the UpdateFunction, the AssociationEnd element can also be a child element of an InsertFunction element or a DeleteFunction element.

  <UpdateFunction FunctionName="AdventureWorksModel.Store.UpdateSalesOrderDetail" >
    <ScalarProperty Name="OrderQty" ParameterName="OrderQty"  Version="Current"/>
    <ScalarProperty Name="SalesOrderDetailID" ParameterName="SalesOrderDetailID" Version="Current"/>
    <ScalarProperty Name="SalesOrderID" ParameterName="SalesOrderID" Version="Original"/>
    <AssociationEnd AssociationSet="FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID"
         From="SalesOrderDetail" To="SalesOrderHeader">
    <ScalarProperty Name="SalesOrderID" ParameterName="SalesOrderID" Version="Current" />
    </AssociationEnd>
    <ResultBinding Name="LineTotal" ColumnName="LineTotal" />
  </UpdateFunction>

See Also

Concepts

ModificationFunctionMapping (EntityTypeMapping)
ModificationFunctionMapping (AssociationSetMapping)
InsertFunction (EntityTypeMapping)
DeleteFunction (EntityTypeMapping)
UpdateFunction (EntityTypeMapping)