Chapter 10. Using Stored Procedures and Database Functions with LINQ to SQL

LINQ to SQL generates dynamic SQL for queries and inserts, updates, and deletes. However, in some cases data access must be made through stored procedures, also called sprocs. Stored procedures may encapsulate business logic, ensure security restrictions, or provide an optimized and restricted way to query or modify data. Occasionally a database may be accessible exclusively through stored procedures. Hence, LINQ to SQL fully supports stored procedures for CRUD operations. This chapter looks at how to specify the stored procedures and database functions for mapping and how to use them to perform CRUD operations.

Stored Procedures and Functions for Querying

Let’s begin ...

Get Essential LINQ 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.