July 2015
Intermediate to advanced
1300 pages
87h 27m
English
LINQ to SQL allows mapping stored procedures from the SQL Server database into a .NET method that you can use within your object model and that is managed by the running instance of the DataContext. In this way, you do not lose the advantage of stored procedures when working with LINQ. To map a stored procedure, go back to the Visual Studio Designer for LINQ to SQL and ensure that the Methods pane is opened on the right side of the designer; then open Server Explorer, expand the database structure, and expand the Stored Procedures folder. After you’ve done this, drag the stored procedure you need onto the Methods pane. Figure 24.8 shows how to accomplish this against the Northwind database of the current example.