by Mikael Henriksson
5. June 2010 18:32
I admit it does not work for everything and only in C# 4 but it’s a useful extension none the less. public static IEnumerable<T> RemoveDuplicates<T>(this IEnumerable<T> items)
{
return new HashSet<T>(items);
}
The hash set does not allow duplicates!
a8e7515c-2efd-4e6c-85a1-4d979ba9e956|1|5.0
Tags: linq, C#
LINQ | C#
by Mikael Henriksson
16. February 2010 08:42
I have created a few very useful extension methods for handling the System.Xml.Linq namespace that I use all the time. I’ve had positive feedback on this before (and it showed up in this post) and now I had to create a couple of extra extensions just to make my life even easier. The way I work...
[More]