2 ms·
Not just yield return. In quite a few different circumstances LINQ will return an IEnumerable<T> that is a wrapper over a query that won't be executed until you
by SideburnsOfDoom 14y ago
Not just yield return. In quite a few different circumstances LINQ will return an IEnumerable<T> that is a wrapper over a query that won't be executed until you try and pull results out of it. LINQ Queries can wrap database queries, http results, active directory, file system or anything else.
And as you note, enumerating it twice can mean doing the underlying query twice, with potentially differing results.