次の方法で共有


サンプル BDC モデル: .NET Connectivity Assembly への接続

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

適用対象: SharePoint Server 2010

次の例は、DotNetAssembly 型の外部システムの単純なモデルを示しています。これは、Class プロパティを使用して, .NET Framework アセンブリへの接続を構成する方法を示します。

注意

アセンブリは、メソッドを実行する前に、BDC またはグローバル アセンブリ キャッシュに展開する必要があります。

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Model Name="ExampleApplicationDefinition" xmlns="https://schemas.microsoft.com/windows/2007/BusinessDataCatalog">
  <LobSystems>
    <LobSystem Name="ExampleCRM" Type="DotNetAssembly">
      <LobSystemInstances>
        <LobSystemInstance Name="ExampleServer" />
      </LobSystemInstances>
      <Entities>
        <Entity Name="Customer" Namespace="example.com" Version="1.0.0.0">
          <Properties>
            <Property Name="Class" Type="System.String">ExampleCrmNamespace.Customer, ExampleCRM</Property>
          </Properties>
          <Identifiers>
            <Identifier Name="CustomerIdentifier" TypeName="System.Int32" />
          </Identifiers>
          <Methods>
            <Method Name="GetCustomers">
              <Parameters>
                <Parameter Name="CustomerId" Direction="In">
                  <TypeDescriptor Name="Id" TypeName="System.Int32" IdentifierName="CustomerIdentifier" />
                </Parameter>
                <Parameter Name="Customers" Direction="Return">
                  <TypeDescriptor Name="CustomerArray" TypeName="ExampleCrmNamespace.Customer[], ExampleCRM" IsCollection="true">
                    <TypeDescriptors>
                      <TypeDescriptor Name="Customer" TypeName="ExampleCrmNamespace.Customer, ExampleCRM">
                        <TypeDescriptors>
                          <TypeDescriptor Name="Id" TypeName="System.Int32" IdentifierName="CustomerIdentifier" />
                          <TypeDescriptor Name="FirstName" TypeName="System.String" />
                          <TypeDescriptor Name="LastName" TypeName="System.String" />
                        </TypeDescriptors>
                      </TypeDescriptor>
                    </TypeDescriptors>
                  </TypeDescriptor>
                </Parameter>
              </Parameters>
              <MethodInstances>
                <MethodInstance Name="GetCustomer" Type="SpecificFinder" ReturnParameterName="Customers" ReturnTypeDescriptorPath="CustomerArray[0]" />
              </MethodInstances>
            </Method>
          </Methods>
        </Entity>
      </Entities>
    </LobSystem>
  </LobSystems>
</Model>