EnumerableAsyncExtensions.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Cysharp.Threading.Tasks
  5. {
  6. public static class EnumerableAsyncExtensions
  7. {
  8. // overload resolver - .Select(async x => { }) : IEnumerable<UniTask<T>>
  9. public static IEnumerable<UniTask> Select<T>(this IEnumerable<T> source, Func<T, UniTask> selector)
  10. {
  11. return System.Linq.Enumerable.Select(source, selector);
  12. }
  13. public static IEnumerable<UniTask<TR>> Select<T, TR>(this IEnumerable<T> source, Func<T, UniTask<TR>> selector)
  14. {
  15. return System.Linq.Enumerable.Select(source, selector);
  16. }
  17. public static IEnumerable<UniTask> Select<T>(this IEnumerable<T> source, Func<T, int, UniTask> selector)
  18. {
  19. return System.Linq.Enumerable.Select(source, selector);
  20. }
  21. public static IEnumerable<UniTask<TR>> Select<T, TR>(this IEnumerable<T> source, Func<T, int, UniTask<TR>> selector)
  22. {
  23. return System.Linq.Enumerable.Select(source, selector);
  24. }
  25. }
  26. }