JetBrains Rider 2026.1 Help

Code inspection: Use method Any()

This inspection reports a LINQ emptiness check written as Count() == 0. Using !Any() expresses the same intent more directly.

Example

bool isEmpty = items.Count() == 0;
bool isEmpty = !items.Any();

Quick-fix

Replace the count comparison with !Any().

29 March 2026