예제 #1
0
        public static List <TSource> ToList <TSource>(this IEnumerable <TSource> source)
        {
            if (source == null)
            {
                throw Error.ArgumentNull("source");
            }
            IIListProvider <TSource> listProvider = source as IIListProvider <TSource>;

            return(listProvider != null?listProvider.ToList() : new List <TSource>(source));
        }
예제 #2
0
        public List <IGrouping <TKey, TElement> > ToList()
        {
            IIListProvider <IGrouping <TKey, TElement> > lookup = Lookup <TKey, TElement> .Create(_source, _keySelector, _elementSelector, _comparer);

            return(lookup.ToList());
        }