AsAsyncEnumerable.cs 1.6 KB

1234567891011121314151617181920212223242526272829
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Collections.Generic;
  5. namespace System.Linq
  6. {
  7. public static partial class AsyncEnumerable
  8. // NB: Synchronous LINQ to Objects doesn't hide the implementation of the source either.
  9. {
  10. #if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES
  11. // Note: this one isn't actually in the System.Linq.AsyncEnumerable package, so we've moved it
  12. // to System.Interactive.Async because that's the home for LINQ-like implementations for
  13. // IAsyncEnumerable<T> that aren't in the runtime libraries.
  14. // It therefore remains available only for runtime binary compatibility, and is no longer
  15. // visible in System.Linq.Async at compile time.
  16. /// <summary>
  17. /// Hides the identity of an async-enumerable sequence.
  18. /// </summary>
  19. /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
  20. /// <param name="source">An async-enumerable sequence whose identity to hide.</param>
  21. /// <returns>An async-enumerable sequence that hides the identity of the source sequence.</returns>
  22. /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
  23. public static IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this IAsyncEnumerable<TSource> source) => source;
  24. #endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES
  25. }
  26. }