How to wrap LINQ to SQL queries in a stored procedure?
LINQ to SQL internally generates SQL queries and fire on the database after submitting changes. Is there any way we can wrap all these queries in some stored procedure and execute this stored procedure every time wh开发者_Go百科en anything gets inserted or updated in the database?
Problem is only stored procedures are allowed to carry any insert or update or delete operations, direct queries are restricted for security purpose.
I think so - see here
You can create the sprocs, add them to your model using the O/R designer and call them from your code. AFAIK, that is all you can do with the stored procedures using LINQ...
精彩评论