public static MapList <K, V> ToMapList <K, V>(this IEnumerable <V> elements, Func <V, K> keySelector) { var result = new MapList <K, V>(); foreach (var element in elements) { var key = keySelector(element); result.Add(key, element); } return(result); }
public bool MapEquals(MapList <TKey, TValue> other) { Func <IList <TValue>, IList <TValue>, bool> listEquals = (a, b) => a.SequenceEqual(b); return(this.DictionaryEquals(other, listEquals)); }