Browse Source

Use C# 8.0 in Concat.

Bart De Smet 7 years ago
parent
commit
dd907ead48
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs

+ 7 - 0
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs

@@ -84,6 +84,12 @@ namespace System.Linq
                         break;
                     }
 
+#if CSHARP8 && AETOR_HAS_CT // CS0656 Missing compiler required member 'System.Collections.Generic.IAsyncEnumerable`1.GetAsyncEnumerator'
+                    await foreach (TSource item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
+                    {
+                        list.Add(item);
+                    }
+#else
                     var e = source.GetAsyncEnumerator(cancellationToken);
 
                     try
@@ -97,6 +103,7 @@ namespace System.Linq
                     {
                         await e.DisposeAsync().ConfigureAwait(false);
                     }
+#endif
                 }
 
                 return list;