Browse Source

Add docs for async enumerable extensionn

pull/988/head
Hsu Still 7 years ago
parent
commit
e37e319ec7
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
1 changed files with 3 additions and 7 deletions
  1. +3
    -7
      src/Discord.Net.Core/Extensions/AsyncEnumerableExtensions.cs

+ 3
- 7
src/Discord.Net.Core/Extensions/AsyncEnumerableExtensions.cs View File

@@ -4,19 +4,15 @@ using System.Threading.Tasks;


namespace Discord namespace Discord
{ {
/// <summary> An extension class for squashing <see cref="IAsyncEnumerable{T}"/>. </summary>
public static class AsyncEnumerableExtensions public static class AsyncEnumerableExtensions
{ {
/// <summary>
/// Flattens the specified pages into one <see cref="IEnumerable{T}"/> asynchronously
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
/// <returns></returns>
/// <summary> Flattens the specified pages into one <see cref="IEnumerable{T}"/> asynchronously. </summary>
public static async Task<IEnumerable<T>> FlattenAsync<T>(this IAsyncEnumerable<IEnumerable<T>> source) public static async Task<IEnumerable<T>> FlattenAsync<T>(this IAsyncEnumerable<IEnumerable<T>> source)
{ {
return await source.Flatten().ToArray().ConfigureAwait(false); return await source.Flatten().ToArray().ConfigureAwait(false);
} }
/// <summary> Flattens the specified pages into one <see cref="IAsyncEnumerable{T}"/>. </summary>
public static IAsyncEnumerable<T> Flatten<T>(this IAsyncEnumerable<IEnumerable<T>> source) public static IAsyncEnumerable<T> Flatten<T>(this IAsyncEnumerable<IEnumerable<T>> source)
{ {
return source.SelectMany(enumerable => enumerable.ToAsyncEnumerable()); return source.SelectMany(enumerable => enumerable.ToAsyncEnumerable());


Loading…
Cancel
Save