Where operator

The LINQ operator that keeps only the items for which a predicate returns true.

In more detail

On an IQueryable<T> it becomes a SQL WHERE clause; on an IEnumerable<T> it runs in memory. Either way it runs nothing until the query is enumerated.

Example

all.Where(p => p.Price < 20m)

Related terms

Taught in

References