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

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

適用対象: SharePoint Server 2010

以下は、BDC モデルの SpecificFinder メソッドの例です。

<Method Name="Read Item" DefaultDisplayName="SalesReason Read Item">
  <Properties>
    <Property Name="BackEndObject" Type="System.String">
      SalesReason</Property>
    <Property Name="BackEndObjectType" Type="System.String">
      SqlServerTable</Property>
    <Property Name="RdbCommandText" Type="System.String">
      SELECT [SalesReasonID] , [Name] , [ReasonType] , [ModifiedDate] 
      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>
    <Parameter Direction="Return" Name="Read Item">
      <TypeDescriptor TypeName="System.Data.IDataReader, System.Data, 
                      Version=2.0.0.0, Culture=neutral, 
                      PublicKeyToken=b77a5c561934e089" 
                      IsCollection="true" 
                      Name="Read Item">
        <TypeDescriptors>
          <TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, 
                          Version=2.0.0.0, Culture=neutral, 
                          PublicKeyToken=b77a5c561934e089" 
                          Name="Read ItemElement">
            <TypeDescriptors>
              <TypeDescriptor TypeName="System.Int32" 
                              ReadOnly="true" 
                              IdentifierName="SalesReasonID" 
                              Name="SalesReasonID" />
              <TypeDescriptor TypeName="System.String" 
                              Name="Name">
                <Properties>
                  <Property Name="RequiredInForms" 
                            Type="System.Boolean">true</Property>
                  <Property Name="Size" Type="System.Int32">50</Property>
                </Properties>
                <Interpretation>
                  <NormalizeString FromLOB="NormalizeToNull" 
                                   ToLOB="NormalizeToEmptyString" />
                </Interpretation>
              </TypeDescriptor>
              <TypeDescriptor TypeName="System.String" 
                              Name="ReasonType">
                <Properties>
                  <Property Name="RequiredInForms" 
                            Type="System.Boolean">true</Property>
                  <Property Name="Size" 
                            Type="System.Int32">50</Property>
                </Properties>
                <Interpretation>
                  <NormalizeString FromLOB="NormalizeToNull" 
                                   ToLOB="NormalizeToEmptyString" />
                </Interpretation>
              </TypeDescriptor>
              <TypeDescriptor TypeName="System.DateTime" 
                              Name="ModifiedDate">
                <Properties>
                  <Property Name="RequiredInForms" 
                            Type="System.Boolean">true</Property>
                </Properties>
                <Interpretation>
                  <NormalizeDateTime LobDateTimeMode="UTC" />
                </Interpretation>
              </TypeDescriptor>
            </TypeDescriptors>
          </TypeDescriptor>
        </TypeDescriptors>
      </TypeDescriptor>
    </Parameter>
  </Parameters>
  <MethodInstances>
    <MethodInstance Type="SpecificFinder" 
                    ReturnParameterName="Read Item" 
                    ReturnTypeDescriptorPath="Read Item[0]" 
                    Default="true" 
                    Name="Read Item" 
                    DefaultDisplayName="SalesReason Read Item">
      <Properties>
        <Property Name="LastDesignedOfficeItemType" 
                  Type="System.String">None</Property>
      </Properties>
    </MethodInstance>
  </MethodInstances>
</Method>

SpecificFinder を含む完全な 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 モデル サンプルが含まれます。