XML スニペット: Deleter メソッドのモデリング

最終更新日: 2010年4月21日

適用対象: SharePoint Server 2010

以下は、BDC モデルの Deleter メソッドの例です。これは、簡単な例であり、データベースでの外部キーの制約を説明しません。

<Method Name="Delete" DefaultDisplayName="SalesReason Delete">
  <Properties>
    <Property Name="BackEndObject" Type="System.String">
      SalesReason</Property>
    <Property Name="BackEndObjectType" Type="System.String">
      SqlServerTable</Property>
    <Property Name="RdbCommandText" Type="System.String">
      DELETE FROM [Sales].[SalesReason] 
      WHERE [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" 
                      Name="SalesReasonID" />
    </Parameter>
  </Parameters>
  <MethodInstances>
    <MethodInstance Type="Deleter" 
                    Name="Delete" 
                    DefaultDisplayName="SalesReason Delete" />
  </MethodInstances>
</Method>

Deleter を含む完全な BDC モデル サンプルのためには、以下の操作を実行します。

  1. Microsoft SharePoint 2010 SDK (英語) をダウンロードします。

  2. bcs sample kit.zip を %ProgramFiles%\Microsoft SDKs\SharePoint 2010\Samples\Business Connectivity Services からローカル フォルダーに抽出します。

  3. ファイルを抽出したフォルダーで、"BDC Models for XML Snippets" フォルダーを探します。このフォルダーには、BDC モデル サンプルが含まれます。