开发者

LINQ Any vs Exists Performance [duplicate]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜