I'm puzzled. I copied this code from the Microsoft LINQ examples site, but can't get it to compile.
I want to do something similar, but it says it cannot resolve symbol minPrice, and a bunch of other errors. What gives?
public void Linq84() {
List products = GetProductList();
var categories =
from p in products
group p by p.Category into g
from minPrice = g.Group.Min(p => p.UnitPrice)
select new {Category = g.Key, CheapestProducts = g.Group.Where(p => p.UnitPrice == minPrice)};
ObjectDumper.Write(categories, 1);
}