question : can we made groupby to multiple fields in LINQ Currently - i have linq something like this
q = q.GroupBy(c => c.Id)
.Select(g => new View
Try this:
q = q.GroupBy(c => new { c.Id, c.name,c.age,c.dob })
.Select(g => new
{
Id = g.Key.Id,
ENAME= string.Join(",", g.Select(x => x.CaseApprover).ToList()),
Name = g.Key.name,
Age = g.Key.age,
Dob = g.Key.dob,
});
This will return an anonymous type, if you want these fields in your View
class, just add them.