LINQ uses lazy evaluation. When you do the following line:
var results = myList.Where(o=>o.Contains("a")).Take(10);
Nothing happens. Only the query is built. When you enumerate results
, (e.g. with a foreach
or a ToList()
) then the Where
and Take
will be applied to myList
: Where
will be executed, as needed, until up to 10 true
values are found.