Why do I need Stored Procedures when I have LINQ to SQL

前端 未结 18 1285
栀梦
栀梦 2021-02-05 15:59

My understanding of Linq to Sql is it will take my Linq statement and convert it into an equivalent SQL statement.

So

var products = from p in db.Product         


        
18条回答
  •  轮回少年
    2021-02-05 16:35

    Security.

    I've seen several "security best practice" guidelines which recommend you do all your data access via SP's, and you only grant privileges to execute those SP's.
    If a client simply cannot do select or delete on any database tables, the risk may be lower should that client be hacked.

    I've never personally worked on a project which worked this way, it always seemed like a giant pain in the backside.

提交回复
热议问题