Posted on: 12/8/2014 9:13:34 AM | Views : 414

I need to group applicantsrecord according to sessionid and also count the username and  send applicantsrecord elements as well as the count of username where as i grouped  record and sent it to view but i need the count as well plz help here is my code
public ActionResult ApplicantsRecord() { List<ApplicantsRecord> ar = new List<ApplicantsRecord>(); //ar = db.ApplicantsRecords.ToList(); var groupedAR = db.ApplicantsRecords.GroupBy(x => x.SessionId) .Select(y => new { SessionId = y.Key, ApplicationsRecords = y.FirstOrDefault(), }).ToList();
foreach (var i in groupedAR) { ar.Add(i.ApplicationsRecords); }
return View(ar);

Go to the complete details ...