예제 #1
0
        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);
        }
예제 #2
0
        public bool MapEquals(MapList <TKey, TValue> other)
        {
            Func <IList <TValue>, IList <TValue>, bool> listEquals = (a, b) => a.SequenceEqual(b);

            return(this.DictionaryEquals(other, listEquals));
        }