I have a lot of code in which I do something like this
bool GetIsUnique(IEnumerable values) { return values.Count() == values.Distinct().Count; } >
I would make this a nice extension method
public static bool IsUnique(this IEnumerable list) { var hs = new HashSet(); return list.All(hs.Add); }
Checks that all items can be added to a HashSet.