Share via


model-declared function (Entity Data Model)

A model-declared function is a function that is declared in a conceptual model, but is not defined in that conceptual model. The function might be defined in the hosting or storage environment. For example, a model-declared function might be mapped to a function that is defined in a database, thus exposing server-side functionality in the conceptual model.

The declaration of a model-declared function contains the following information:

  • The name of the function. (Required)

  • The type of the return value. (Optional)

    NoteNote:

    If no return value is specified, the return type is void.

  • Parameter information, including parameter name and type. (Optional)

Example

The ADO.NET Entity Framework uses a domain-specific language (DSL) called conceptual schema definition language (CSDL) to define conceptual models. In CSDL, one implementation of a model-declared function is a function import. The following CSDL defines an entity container with a function import definition. Note that the return type for the function is void since no return type is specified.

<FunctionImport Name="UpdatePublisher">
  <Parameter Name="PublisherId" Mode="In" Type="Int32" />
  <Parameter Name="PublisherName" Mode="In" Type="String" />
</FunctionImport>

See Also

Concepts

Entity Data Model Key Concepts

Entity Data Model