示例#1
0
        public static System.Linq.ILookup <TKey, TSource> ToLookup <TSource, TKey>(this ReadOnlyMemory <TSource> source, Func <TSource, TKey> keySelector, IEqualityComparer <TKey> comparer = null)
        {
            var aggregate = new ToLookup <TSource, TKey>(comparer, keySelector);

            MemoryNode.ProcessMemory(source, ref aggregate);
            return(aggregate.GetResult());
        }
示例#2
0
        public static System.Linq.ILookup <TKey, TElement> ToLookup <TSource, TKey, TElement>(this TSource[] source, Func <TSource, TKey> keySelector, Func <TSource, TElement> elementSelector, IEqualityComparer <TKey> comparer = null)
        {
            var aggregate = new ToLookup <TSource, TKey, TElement>(comparer, keySelector, elementSelector);

            ArrayNode.ProcessArray(source, ref aggregate);
            return(aggregate.GetResult());
        }
示例#3
0
        public static System.Linq.ILookup <TKey, TSource> ToLookup <TSource, TKey>(this List <TSource> source, Func <TSource, TKey> keySelector, IEqualityComparer <TKey> comparer = null)
        {
            var aggregate = new ToLookup <TSource, TKey>(comparer, keySelector);

            ListSegmentNode.ProcessList(source, ref aggregate);
            return(aggregate.GetResult());
        }