你的位置: 码友网首页 / 资讯源列表 / Any() vs Count() in .NET: Which One is Better?

关于[Any() vs Count() in .NET: Which One is Better?]的摘要:

In this article, we are going to learn the main differences between Any and Count methods from LINQ. We work with different collections in C# all the time, and we often need to check if there are any records inside the collection or if it is empty. Both methods can help us to achieve that. We are going to see how each method works internally and compare the efficiency of each approach to determine which one we should use in specific use cases.

原文地址: https://code-maze.com/any-vs-count-dotnet/

收录时间: 2022-09-07 浏览量: 1685 分类: .NET

| 1 收藏 | 0