Answers for "get duplicate row linq"

C#
2

find duplicates c# array linq

var query = lst.GroupBy(x => x)
              .Where(g => g.Count() > 1)
              .Select(y => y.Key)
              .ToList();
Posted by: Guest on June-08-2020
0

find duplicates in lists with LINQ and get count

var query = lst.GroupBy(x => x)
              .Where(g => g.Count() > 1)
              .Select(y => new { Element = y.Key, Counter = y.Count() })
              .ToList();
Posted by: Guest on April-20-2021

C# Answers by Framework

Browse Popular Code Answers by Language