Skip to content

Commit a51fe48

Browse files
dennisdoomenDennis DoomenCopilot
authored
Update AV1800 guideline (#375)
Split from #298. Co-authored-by: Dennis Doomen <dennis.doomen@greenchoice.nl> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 76c7e50 commit a51fe48

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

_rules/1800.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ title: Consider using `Any()` to determine whether an `IEnumerable<T>` is empty
55
severity: 3
66
---
77
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).
8-
9-
**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.

0 commit comments

Comments
 (0)