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); }
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))); }
internal static Task <HashSet <T> > ToHashSetAsync <T>(this IDbAsyncEnumerable source) { return(IDbAsyncEnumerableExtensions.ToHashSetAsync <T>(source, CancellationToken.None)); }