JetBrains Rider 2026.1 Help

Code inspection: Simplify LINQ expression (use 'All')

This inspection reports a negated Any(...) call that is equivalent to All(...). This usually appears when code checks that no element matches a predicate. Using All(...) expresses that intent more directly.

Example

bool allNonZero = !xs.Any(x => x == 0);
bool allNonZero = xs.All(x => x != 0);

Quick-fix

Replace the negated Any(...) call with an equivalent All(...) call.

29 March 2026