Tag: LINQ

Filtering duplicates out of an IEnumerable

Problem: Filtering out(removing duplicates) from an IEnumerable One possible solution with using linq would be to group by key and take the first element of each group. Here’s an example: enumerable.GroupBy(x => x.key).Select(g => g.First()) Advertisements