/// <summary> /// Create from tasks /// </summary> /// <param name="tasks"></param> /// <returns></returns> #pragma warning disable IDE1006 // Naming Styles public static async Task <IAsyncDisposable> AsAsyncDisposable( this IEnumerable <Task <IAsyncDisposable> > tasks) { #pragma warning restore IDE1006 // Naming Styles return(new AsyncDisposable(await AsyncDisposable.WhenAll(tasks))); }
/// <summary> /// Safe waiting for disposables /// </summary> /// <param name="disposables"></param> /// <returns></returns> public static Task DisposeAsync( this IEnumerable <IAsyncDisposable> disposables) { return(AsyncDisposable.DisposeAsync(disposables)); }