Freigeben über


FunctionImport Element (CSDL)

The FunctionImport element in conceptual schema definition language (CSDL) in the Entity Data Model (EDM) specifies the details of a stored procedure that exists in the database and is mapped to an entity and its properties. Nested parameter elements specify the names of parameters and their data types. For a how-to topic that shows a working example of a stored procedure mapped to EDM types, see How to: Define a Model with a Stored Procedure (Entity Framework)

The following syntax defines the GetOrderDetails function. The EntitySet named SalesOrderDetail is assigned to the function and the return type is defined as a collection of SalesOrderDetail entities. A corresponding GetOrderDetails function must be defined in store schema definition language (SSDL) and mapped to storage in mapping specification language (MSL).

<FunctionImport Name="GetOrderDetails"
    EntitySet="SalesOrderDetail"
    ReturnType="Collection(AdventureWorksModel.SalesOrderDetail)">
  <Parameter Name="SalesOrderHeaderId" Type="Int32" Mode="In">
  </Parameter>
</FunctionImport>

See Also

Tasks

How to: Define a Model with a Stored Procedure (Entity Framework)
How to: Execute a Query Using a Stored Procedure (Entity Framework)

Concepts

Stored Procedure Support (Entity Framework)