Difference between && and where condition in entity framework query

前端 未结 3 1385
暗喜
暗喜 2020-12-10 17:05

Difference between and condition and two where condition in entity framework query

Code 1

I have using two where condition in my query

3条回答
  •  一整个雨季
    2020-12-10 17:27

    Both queries are same. But Query 2 will give you better performance, as && will help you in short-circuit. In the first query, first where will yield the result and that will be given to 2nd where clause and then it will evaluate result based on the input. Let me know if you need more info.

提交回复
热议问题