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

前端 未结 18 1092
栀梦
栀梦 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:25

    Simple example:

    select * from Products where GetCategoryType(CategoryName)=1
    

    GetCategoryType can run really fast, because it runs on the DB server. There's no Linq to SQL substitute for that as far as I know.

提交回复
热议问题