Extension methods syntax vs query syntax

后端 未结 7 1120
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 12:42

I\'m trying to get a handle on if there\'s a good time to use standard linq keywords or linq extension methods with lambda expressions. They seems to do the same thing, jus

7条回答
  •  隐瞒了意图╮
    2020-11-27 13:30

    They compile the same, and are equivalent. Personally, I prefer the lambda (extension) methods for most things, only using the statements (standard) if I'm doing LINQ to SQL or otherwise trying to emulate SQL. I find that the lambda methods flow better with code, whereas the statements are visually distracting.

提交回复
热议问题