Share via


Parameter

Parameter objects define the in, out, and return parameters of each method. Parameters contain information such as:

  • The direction of the parameter (In, Out, InOut, Return).

  • The ordinal number of the parameter in the method signature.

  • Whether the parameter is optional.

  • The TypeReflector. Every Parameter object contains a TypeReflector. The TypeReflector is responsible for instantiating a Parameter object filled with default values according to the structure indicated by the TypeDescriptor, and getting or setting values for individual fields referenced by type descriptors in the instantiated Parameter object.

A return parameter in the Business Data Catalog is the value it should read from the back-end application.

Note

In Microsoft Office SharePoint Server 2007, the return parameter of a method should be the last parameter listed in the method's parameter list.

In cases where a Web method returns void, it is likely returning a value in an out parameter. You must describe that parameter as the return parameter in the metadata.

For Web methods, parameter names are tokens used by the Business Data Catalog. Though they must be unique for a given method, you can name them anything. TypeDescriptor names, however, must exactly match the structures and fields returned by the back-end application methods.

In the case of a database, the parameter names must exactly match the parameter names in the stored procedure or SQL query.

Note

In Microsoft Office SharePoint Server 2007, Business Data Catalog does not support return values from SQL parameters or stored procedures. Also, it only supports database queries or stored procedures that return a single record set from the database.

Examples

The following examples show an input parameter and a return parameter that represent a collection of customer entity instances.

Input Parameter

<Parameters>
   <Parameter Direction="In" Name="@minCustId">
   ….
   ….
   </Parameter>
   <Parameter …..>
   </Parameter>
</Parameters>

Return Parameter

<Parameters>
   <Parameter Direction="Return" Name="Customers">
   ….
   ….
   </Parameter>
</Parameters>

Schema

Child Type Occurs Default Limits / Accepted Values Description

Direction

Attribute (bdc:ParameterDirection)

1..1

In

Out

InOut

Return

Specifies the direction in which the parameter is passed between the Business Data Catalog and the system.

In: Business Data Catalog initializes the parameter and passes it to the system

Out: System initializes the parameter and passes it to the Business Data Catalog (corresponds to Visual C# out keyword).

InOut: Business Data Catalog initializes the parameter and passes it to the system, which may modify it before returning it to the Business Data Catalog. (corresponds to Visual C# ref keyword).

Return: The system initializes the parameter and passes it to the Business Data Catalog as the return value of a method. In Microsoft Office SharePoint Server 2007, the return parameter of a method should be the last parameter listed in the method's parameter list.

TypeReflectorTypeName

Attribute

Specifies the fully qualified name of a custom ITypeReflector.

TypeDescriptor

Element

1..1

TypeDescriptor describing the type of this parameter.

See Also

Tasks

AdventureWorks SQL Server 2000 Sample
How to: Get Started with Using the Runtime Object Model
How to: Get Started with Using the Administration Object Model

Concepts

FAQ: Business Data Catalog
Business Data Catalog: Glossary