FunctionImportMapping Element (MSL)

The FunctionImportMapping element in mapping specification language (MSL) defines the mapping between a function import in the conceptual model and a stored procedure or function in the underlying database. Function imports must be declared in the conceptual model and stored procedures must be declared in the storage model. For more information, see FunctionImport Element (CSDL) and Function Element (SSDL).


By default, if a function import returns a conceptual model entity type or complex type, then the names of the columns returned by the underlying stored procedure must exactly match the names of the properties on the conceptual model type. If the column names to not exactly match the property names, the mapping must be defined in a ResultMapping element.

The FunctionImportMapping element can have the following child elements:

Applicable Attributes

The following table describes the attributes that are applicable to the FunctionImportMapping element:

Attribute Name Is Required Value



The name of the function import in the conceptual model that is being mapped.



The namespace-qualified name of the function in the storage model that is being mapped.


The following example is based on the School model. Consider the following function in the storage model:

<Function Name="GetStudentGrades" Aggregate="false" 
          BuiltIn="false" NiladicFunction="false" 
          IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" 
  <Parameter Name="StudentID" Type="int" Mode="In" />

Also consider this function import in the conceptual model:

<FunctionImport Name="GetStudentGrades" EntitySet="StudentGrades" 
  <Parameter Name="StudentID" Mode="In" Type="Int32" />

The following example show a FunctionImportMapping element used to map the function and function import above to each other:

<FunctionImportMapping FunctionImportName="GetStudentGrades"
                       FunctionName="SchoolModel.Store.GetStudentGrades" />

See Also

Other Resources

CSDL, SSDL, and MSL Specifications
Modeling and Mapping
How to: Import a Stored Procedure