Biplob Bipul

Biplob Bipul

  • NA
  • 10
  • 2.9k

Linq groupby and count from Table List variable.

Oct 12 2015 1:33 AM
List<Qry_GrandResultAttendance> lst_GrandResultAttendance = new List<Qry_GrandResultAttendance>();
 lst_GrandResultAttendanceDetails = GetGrandResultAttendanceDetails(version, session, branch, shift, _class, group, section).ToList(); 
 
  "lst_GrandResultAttendanceDetails" variable  contains below content...
 
 Present SiNo Name Date
 1 1 a 1-1-2015
 1 1 a  2-1-2015
 1 1a  3-1-2015
 1 2b  1-1-2015
 1 2 b 2-1-2015
 1 3 c  1-1-2015
 1 3 c 2-1-2015
    
    
    
 
now I want that Grouping by "SiNo" and Count , As like as List<Qry_GrandResultAttendance> New_lst_GrandResultAttendance = new List<Qry_GrandResultAttendance>();
New_lst_GrandResultAttendance= lst_GrandResultAttendance.Group By (SiNo).Count......(How Linq Wrrite there), which output of "New_lst_GrandResultAttendance" below List.
 Present Si Name Date
 3 1 a
 2 2 b 
   2                                         3             c         
 
 

Answers (2)