Deferred operators
Context: Deferred operators (e.g., Where, Select, OrderBy) do not execute until the query is enumerated. They return an IEnumerable<T>.
var deferred = numbers.Where(n => n > 2); // no execution// Execution happens hereforeach (var item in deferred) { }List of common deferred operators
Section titled “List of common deferred operators”Where,Select,SelectManyTake,SkipOrderBy,OrderByDescending,ThenByGroupBy,Join,GroupJoinConcat,Distinct,Union,Intersect,Except
Real-world usage example
Section titled “Real-world usage example”Complex query composition: Deferred execution allows you to build queries conditionally without performance penalty until the final enumeration.
Example: In EF Core, all IQueryable operators are deferred until ToList() or foreach.