LinQ is very powerfull, really really powerfull.
Referring to my last post (LinQ: Max() vs OrderBy()-FirstOrDefault()) here is a similar example:
var i = (from item in listOfItems
where item.Size = listOfItems.Max(i => i.Size)
What about performance ?
What about that “listOfItems.Max(i => i.Size)” ?
Will be executed every iteration, or cached before cycle ?
Reflector may help you exploring the code LinQ is compiled in.
Dustin Campbell had same idea, with this post. 😉
source: Using Reflector to Explore LINQ