Mapping stored procedures to functions in the EDM
Stored procedures are represented as functions in the EDM. To use these functions, they should be mapped to a corresponding insert, update, or delete operation on the entity. To do this, you need to first create a function import and then use the designer to create its mapping. In this section, you will learn how to create these function imports for your EDM.
To begin, let's refer to the EDM we created earlier in this chapter. To create function imports, follow these steps:
Switch to the Model Browser of the
Payroll
Entity Data Model.Expand the Entity Container and right-click on Function Imports.
When you select Create Function Import, the New Function Import dialog appears and allows you to select the stored procedure you want from the list of available stored procedures.
Now, map the
Employee_Insert
stored procedure to a corresponding function import by selecting the stored procedure name, the function import name, and the return type. Note...