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, we will learn how to create these Function Imports for our EDM.
To begin, let's refer to the Entity Data Model we created in chapter 2:
To create Function Imports, follow these steps:
1. Switch to the Model Browser of the Payroll Entity Data Model.
2. Expand the Entity Container and right click on Function Imports as shown in the following figure:
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. This is shown in the following figure:
3. Now map the Employee_Insert stored procedure to a corresponding function import by selecting...