How to Use LINQ to Get a Count of Duplicates in a List
Often we have to get a count of duplicate items in a list. An easy way to do this is to group the list on the property we want to count, then use LINQ's GroupBy's Count feature. Below is a quick example using an employee list.
private static void Main()
{
List<Employee> empList = new List<Employee>();
empList.Add(new [...]

Read Users' Comments (0)