Wednesday, November 16, 2022

Group By with count LINQ ASP.NET C#

/var disciplineCount = dt.AsEnumerable().GroupBy(x => x.Field<string>("Discipline"), (key, g)=> new { discipline = key, disciplinecount = g.Count() }).ToList();


if((disciplineCount.Exists(d => d.discipline == DataBinder.Eval(e.Row.DataItem, "Discipline").ToString() && d.disciplinecount > 1)))

{


}

No comments:

Post a Comment