public static IDistinctValuedDictionary <TKey, TValue> ToDistinctValued <TKey, TValue>(this IDictionary <TKey, TValue> dictionary, IEqualityComparer <TValue> valueEqualityComparer) { // Verify that the values are distinct (exception will be thrown if not). dictionary.Values.VerifyDistinct(valueEqualityComparer); // Input passes, so just wrap it. return(dictionary.Wrap()); }
public static IDistinctValuedDictionary <TKey, TValue> AsDistinctValued <TKey, TValue>(this IDictionary <TKey, TValue> dictionary) { return(dictionary.Wrap()); }