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 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 25.8 shows how to accomplish this against the Northwind database of the current example.