AsAsyncEnumerable.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233
  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. #if REFERENCE_ASSEMBLY
  8. public static partial class AsyncEnumerableDeprecated
  9. #else
  10. public static partial class AsyncEnumerable
  11. #endif
  12. // NB: Synchronous LINQ to Objects doesn't hide the implementation of the source either.
  13. {
  14. #if INCLUDE_RELOCATED_TO_INTERACTIVE_ASYNC
  15. // Note: this one isn't actually in the System.Linq.AsyncEnumerable package, so we've moved it
  16. // to System.Interactive.Async because that's the home for LINQ-like implementations for
  17. // IAsyncEnumerable<T> that aren't in the runtime libraries.
  18. // It therefore remains available only for runtime binary compatibility, and is no longer
  19. // visible in System.Linq.Async at compile time.
  20. /// <summary>
  21. /// Hides the identity of an async-enumerable sequence.
  22. /// </summary>
  23. /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
  24. /// <param name="source">An async-enumerable sequence whose identity to hide.</param>
  25. /// <returns>An async-enumerable sequence that hides the identity of the source sequence.</returns>
  26. /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
  27. public static IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this IAsyncEnumerable<TSource> source) => source;
  28. #endif // INCLUDE_RELOCATED_TO_INTERACTIVE_ASYNC
  29. }
  30. }