From 70af6b0ac4db90ce5b63250548edf2ea5c03da6a Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 25 Mar 2026 07:12:25 -0700 Subject: [PATCH] Update AV1800 guideline Split from #298. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- _rules/1800.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/_rules/1800.md b/_rules/1800.md index 21e73073..de602176 100644 --- a/_rules/1800.md +++ b/_rules/1800.md @@ -5,5 +5,3 @@ title: Consider using `Any()` to determine whether an `IEnumerable` is empty severity: 3 --- When a member or local function returns an `IEnumerable` 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` to a persistent store). - -**Note:** If you return an `IEnumerable` 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.