Switching to LINQ

后端 未结 5 1657
花落未央
花落未央 2021-02-09 19:15

I\'m considering spending time learning and using LINQ to SQL but after years of best practices advising NOT to embed SQL I\'m having a hard time changing paradigms.

Why

5条回答
  •  北海茫月
    2021-02-09 19:47

    I don't think of it as embedding SQL in your code any more than embedding a Stored Proc name in your code is. More often than not a change to your Proc involves change to your code anyway. For example, you usually need to add a new in/out parameter or update a getter/setter method to reference a new column.

    What it does is remove a lot of the leg work of writing twice as much code to align properties and methods in your code with procs and columns in your DB.

提交回复
热议问题