I have a list of objects with properties Text, double1, and double 2. How would i formulate the the linq query to get the average of the two doubles grouped by the Text field? Seems fairly simple, but I have yet to find an example I can get to work.
Answer:
var query =
from x in items
group x by x.Text into g
select new {
Text = g.Key,
Average1 = g.Average(x => x.Double1),
Average2 = g.Average(x => x.Double2)
};