Compartilhar via


XML Snippet: Use Input Filters in a BDC Model

Applies to: SharePoint Server 2010

The following is an example of an input filter in a BDC model.

Example

<Method Name="FindEmployeesByFilter">
  <FilterDescriptors>
    <FilterDescriptor Type="Input" FilterField="EmployeeFirstName" Name="EmployeeFirstNameFilter" />
  </FilterDescriptors>
  <Parameters>
    <Parameter Direction="In" Name="MinEmployeeId">
      <TypeDescriptor TypeName="System.Int32" IdentifierName="EmployeeId" Name="MinEmployeeId">
        <DefaultValues>
          <DefaultValue MethodInstanceName="FindEmployeesInstanceByFilter" Type="System.Int32">0</DefaultValue>
        </DefaultValues>
      </TypeDescriptor>
    </Parameter>
    <Parameter Direction="In" Name="MaxEmployeeId">
      <TypeDescriptor TypeName="System.Int32" IdentifierName="EmployeeId" Name="MaxEmployeeId">
        <DefaultValues>
          <DefaultValue MethodInstanceName="FindEmployeesInstanceByFilter" Type="System.Int32">9999999</DefaultValue>
        </DefaultValues>
      </TypeDescriptor>
    </Parameter>
    <Parameter Direction="In" Name="MaxEmployees">
      <TypeDescriptor TypeName="System.Int32" IdentifierName="EmployeeId" Name="MaxEmployees">
        <DefaultValues>
          <DefaultValue MethodInstanceName="FindEmployeesInstanceByFilter" Type="System.Int32">9999999</DefaultValue>
        </DefaultValues>
      </TypeDescriptor>
    </Parameter>
    <Parameter Direction="In" Name="EmployeeFirstName">
      <TypeDescriptor TypeName="System.String" AssociatedFilter="EmployeeFirstNameFilter" Name="EmployeeFirstName">
        <DefaultValues>
          <DefaultValue MethodInstanceName="FindEmployeesInstanceByFilter" Type="System.String">A</DefaultValue>
        </DefaultValues>
      </TypeDescriptor>
    </Parameter>
    <Parameter Direction="In" Name="LastIdSeen">
      <TypeDescriptor TypeName="System.Int32" IdentifierName="EmployeeId" Name="LastIdSeen">
        <DefaultValues>
          <DefaultValue MethodInstanceName="FindEmployeesInstanceByFilter" Type="System.Int32">0</DefaultValue>
        </DefaultValues>
      </TypeDescriptor>
    </Parameter>
    <Parameter Direction="Return" Name="Employees">
      <TypeDescriptor TypeName="LOBDataManager.Employee[], WCFLobSystem-InputFilter" IsCollection="true" Name="EmployeeDataReader">
        <TypeDescriptors>
          <TypeDescriptor TypeName="LOBDataManager.Employee, WCFLobSystem-InputFilter" Name="EmployeeDataRecord">
            <TypeDescriptors>
              <TypeDescriptor TypeName="System.Int32" IdentifierName="EmployeeId" Name="EmployeeId" />
              <TypeDescriptor TypeName="System.Nullable`1[[System.Int32]]" IdentifierName="EmployeeId" ForeignIdentifierAssociationName="GetEmployeeReportsAssociation" Name="ManagerId" />
              <TypeDescriptor TypeName="System.String" Name="EmployeeFirstName" />
              <TypeDescriptor TypeName="System.String" Name="EmployeeLastName" />
              <TypeDescriptor TypeName="System.String" Name="Telephone" />
              <TypeDescriptor TypeName="System.DateTime" Significant="false" Name="LastModified">
                <Interpretation>
                  <NormalizeDateTime LobDateTimeMode="UTC" />
                </Interpretation>
              </TypeDescriptor>
            </TypeDescriptors>
          </TypeDescriptor>
        </TypeDescriptors>
      </TypeDescriptor>
    </Parameter>
  </Parameters>
  <MethodInstances>
    <MethodInstance Type="Finder" ReturnParameterName="Employees" Default="true" Name="FindEmployeesInstanceByFilter" />
  </MethodInstances>
</Method>