开发者

How to wrap LINQ to SQL queries in a stored procedure?

开发者 https://www.devze.com 2022-12-25 13:31 出处:网络
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 procedur

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号