示例#1
0
        internal static async Task <HashSet <T> > ToHashSetAsync <T>(this IDbAsyncEnumerable source, CancellationToken cancellationToken)
        {
            var hashSet = new HashSet <T>();
            await TaskExtensions.WithCurrentCulture(IDbAsyncEnumerableExtensions.ForEachAsync(source, (Action <object>)(e => hashSet.Add((T)e)), cancellationToken));

            return(hashSet);
        }
示例#2
0
        public static Task <HashSet <TSource> > ToHashSetAsync <TSource>(this IQueryable <TSource> source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            return(IDbAsyncEnumerableExtensions.ToHashSetAsync <TSource>(QueryableExtensions.AsDbAsyncEnumerable <TSource>(source)));
        }
示例#3
0
 internal static Task <HashSet <T> > ToHashSetAsync <T>(this IDbAsyncEnumerable source)
 {
     return(IDbAsyncEnumerableExtensions.ToHashSetAsync <T>(source, CancellationToken.None));
 }