public static Task <T[]> ToArray <T>(this IAsyncEnumerator <T> asyncEnumerator) => asyncEnumerator.ToList() .ContinueWith(listTask => listTask.GetAwaiter().GetResult().ToArray());