开发者

LINQ Any vs Exists Performance [duplicate]

开发者 https://www.devze.com 2023-03-20 03:49 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Linq .Any VS .Exists - Whats the difference?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Linq .Any VS .Exists - Whats the difference?

Is there a performance difference between using any vs exists in a LINQ query开发者_C百科? Specifically LINQ to Entities.


Exists requires an instance of List<T> while Any is invoked on IEnumerable<T>. This means you have the potential for increased memory efficiency as IEnumerable<T> can be evaluated lazily.

0

精彩评论

暂无评论...
验证码 换一张
取 消