JetBrains Rider 2026.1 Help

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

This inspection reports a LINQ query that filters with Where(...) and then immediately calls First(). The same query is shorter and clearer as a single First(...) call.

Example

var item = items.Where(x => x.IsActive).First();
var item = items.First(x => x.IsActive);

Quick-fix

Replace the Where(...).First() chain with First(...).

29 March 2026