Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions _rules/1800.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ title: Consider using `Any()` to determine whether an `IEnumerable<T>` is empty
severity: 3
---
When a member or local function returns an `IEnumerable<T>` or other collection class that does not expose a `Count` property, use the `Any()` extension method rather than `Count()` to determine whether the collection contains items. If you do use `Count()`, you risk that iterating over the entire collection might have a significant impact (such as when it really is an `IQueryable<T>` to a persistent store).

**Note:** If you return an `IEnumerable<T>` to prevent changes from calling code as explained in [{{ site.default_rule_prefix }}1130](/member-design-guidelines#{{ site.default_rule_prefix }}1130), and you're developing in .NET 4.5 or higher, consider the new read-only classes.