XML Snippet: Modeling a Disassociator Method
Applies to: SharePoint Server 2010
The following is an example of an Disassociator method in a BDC model.
Example
<Method IsStatic="false" Name="Sales Order by Reason Disassociator"
DefaultDisplayName="Sales Order by Reason Disassociator">
<Properties>
<Property Name="BackEndObject" Type="System.String">
SalesOrderHeaderSalesReason</Property>
<Property Name="BackEndObjectType" Type="System.String">
SqlServerTable</Property>
<Property Name="RdbCommandText" Type="System.String">
DELETE FROM [Sales].[SalesOrderHeaderSalesReason]
WHERE SalesOrderID = @SalesOrderID and SalesReasonID = @SalesReasonID
</Property>
<Property Name="RdbCommandType" Type="System.Data.CommandType,
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">Text</Property>
<Property Name="Schema" Type="System.String">Sales</Property>
</Properties>
<Parameters>
<Parameter Direction="In" Name="@SalesReasonID">
<TypeDescriptor TypeName="System.Int32" IdentifierName="SalesReasonID"
IdentifierEntityName="SalesReason"
IdentifierEntityNamespace="AdventureWorks"
ForeignIdentifierAssociationName="Sales Order by Reason Disassociator"
Name="SalesReasonID" />
</Parameter>
<Parameter Direction="In" Name="@SalesOrderID">
<TypeDescriptor TypeName="System.Int32" IdentifierName="SalesOrderID"
IdentifierEntityName="SalesOrder"
IdentifierEntityNamespace="AdventureWorks"
Name="SalesOrderID" />
</Parameter>
</Parameters>
<MethodInstances>
<Association Type="Disassociator" Name="Sales Order by Reason Disassociator"
DefaultDisplayName="Sales Order by Reason Disassociator">
<SourceEntity Namespace="AdventureWorks" Name="SalesReason" />
<DestinationEntity Namespace="AdventureWorks" Name="SalesOrder" />
</Association>
</MethodInstances>
</Method>
For a complete BDC model sample that includes a Disassociator, do the following:
Download the Microsoft SharePoint 2010 SDK.
Extract "bcs sample kit.zip" from "%ProgramFiles%\Microsoft SDKs\SharePoint 2010\Samples\Business Connectivity Services" to a local folder.
In the folder where you extracted the files, locate the "BDC Models for XML Snippets" folder. This folder contains BDC model samples.