Linq over Stored Procedures

后端 未结 9 514
长情又很酷
长情又很酷 2021-01-05 11:19

What are some pros and cons of using linq over stored procedures?

9条回答
  •  隐瞒了意图╮
    2021-01-05 12:13

    LINQ is a wonderful addition to the .Net Framework, it does, however, have it's limitations. As of yet LINQ does not yet support all of the SQL Syntax (though I'm sure they're working on it). Also, with LINQ there is no clean way of having it process multiple tables and give us only the data we need. With LINQ you would have to retrieve all the data, then keep what you want and throw the rest out, thus transmitting more data than is actually needed, which is a performance issue.

    If all you're doing is simple INSERT, UPDATE, and DELETE statements LINQ is the way to go (in my opinion) and all the optimization is done for you, for more complex work I would say to stick with stored procedures.

提交回复
热议问题