Hi all,
If I have set of fields of which I use some for grouping and some for aggregating, how can I have other fields in the final step where the aggregating also takes place?
Suppose there is also a t.c and a t.d in the input sequence that I want in the select new part, how to do that?
???
If I have set of fields of which I use some for grouping and some for aggregating, how can I have other fields in the final step where the aggregating also takes place?
Suppose there is also a t.c and a t.d in the input sequence that I want in the select new part, how to do that?
Code:
var output =
from t in input
group t
by new
{
w = t.a,
x = t.b
}
into s
select new
{
w = s.Key.w,
x = s.Key.x,
a = s.Average(u => u.q)
};