Mapping Stored Procedures

The Entity Framework enables you to import stored procedures from a SQL Server database into the object model and Visual Studio 2015 makes thing easy. In this section you learn to add stored procedure mappings to the entity data model. To accomplish this, first open the Visual Studio designer by double-clicking the Northwind.edmx file in Solution Explorer. When ready, right-click the designer and select the Update Model from Database command. This launches again the wizard that enables you to select database objects not included yet in the entity data model. Now, expand the Stored Procedures item and select the Ten Most Expensive Products stored procedure, as shown in Figure 26.13.

FIGURE 26.13 Adding a stored procedure ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.