0

Hi I got data in datatable like this

Aid Bid Atext Aword  CrDate
1    1   hi    h      now
1    1   hii   hi     now
1    2   k     k      now
2    1   kk    k      now
2    3   kkk   k      now

Aid with Bid, A and B is different entity. I want to group by the other colums My try is

var groups= _context.VmAuthBooks.GroupBy(x=>x.Aid);

it gives error.

Client Side GroupBy is not supported.

I want to group them by Aid && Bid like

var groups= _context.VmAuthBooks.GroupBy(x=>x.Aid && x=>x.Bid);

Then get the Atext Aword CrDate It will be like

Aid Bid
1   1 textcount
1   2 textcount
2   1 textcount
2   3 textcount

Thank you

  • Possible duplicated https://stackoverflow.com/questions/58138556/client-side-groupby-is-not-supported – Zen Nov 11 '20 at 08:39
  • var result = solvedExercises .GroupBy(e => e.StudentId) .ToDictionary(e => e.Key, e => e.Select(e2 => e2.ExerciseId).ToList()); is good answer but I gotta make it by 2 id – masterpanda Nov 11 '20 at 08:52
  • To group by multi fileds, try this ` .GroupBy(x => new {Aid, Bid}) .Select(e => new {e.Key, Count = e.Count()}) .ToDictionary(e => e.Key, e => e.Count);` – Zen Nov 11 '20 at 09:23

0 Answers0