ReSharper 2026.1 Help

Code inspection: Replace with single call to Any(..)

This inspection reports LINQ code that filters a sequence with Where(...) and then immediately calls Any().

The extra Where(...) call is unnecessary. Passing the predicate directly to Any(...) is shorter and avoids building an extra query step.

Example

var hasLargeNumber = numbers.Where(x => x > 10).Any();
var hasLargeNumber = numbers.Any(x => x > 10);

Quick-fix

The quick-fix replaces the Where(...).Any() chain with a single call to Any(...).

14 April 2026