Share via


2.1.16 FunctionImport ReturnType

A ReturnType describes the shape of data that is returned from a FunctionImport element. ReturnType is used to map to stored procedures with multiple result sets. In CSDL 3.0, the return type of a function import can be declared as a child element.

The following is an example of the ReturnType element.

 <FunctionImport Name="GetOrdersAndProducts">  <ReturnType Type="Collection(Self.Order)" EntitySet="Orders"/>  <ReturnType Type="Collection(Self.Product)" EntitySet="Products"/></FunctionImport>

The following rules apply to the FunctionImport ReturnType element:

  • ReturnType can define type declarations as an attribute.

  • If defined in CSDL 1.1, CSDL 2.0, or CSDL 3.0, the Type of FunctionImport ReturnType MUST be an EDMSimpleType, EntityType, or ComplexType that is in scope or a collection of one of these in-scope types. In CSDL 1.0, the ReturnType is a collection of either EDMSimpleType or EntityType.

  • ReturnType can contain any number of AnnotationAttribute attributes. The full names of the AnnotationAttribute attributes cannot collide.

  • The order of the ReturnType elements MUST match that of the underlying stored procedure.

Graphic representation in table format of the rules that apply to the ReturnType element of a given FunctionImport element.