【发布时间】:2023-03-22 09:26:01
【问题描述】:
我正在使用 Entity Framework 4.1 和 C#。
哪一个最适合发挥最佳性能?
如果是这样 - 为什么? (任何其他阅读的链接)?
bool isBoarding = invoice.Allocations.Where(a => a.Service.Key == "boarding").Count() > 0;
或
bool isBoarding = invoice.Allocations.Any(a => a.Service.Key == "boarding");
【问题讨论】:
-
感谢您提供有用的链接。
标签: c# performance tsql linq-to-entities entity-framework-4.1