Stored Procedures with Entity Framework
Overview
¶
This article walks through adding a stored procedure to an Entity Model.
Details
¶
This procedure assumes you have already added the stored procedure to your Entity Model via
Update Model from Database
.
1. Open your Entity Model and right click on the design surface. From the context menu choose
Model Browser
.
Entity Model Context Menu
2. In the Model Browser, navigate to one of the following two places
MyEntities.edmx
>
MyModel
>
EntityContainer: MyEntities
>
Function Imports
> right click >
Add Function Import
MyEntities.edmx
>
MyModel.Store
>
Stored Procedure
>
GetMenuItems
stored procedure > right click >
Add Function Import
Model Browser