Browse Source

Moving non-standard SelectMany overload to AsyncEnumerableEx.

Bart De Smet 8 years ago
parent
commit
c08f34be5f

+ 2 - 2
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Multiple.cs

@@ -962,8 +962,8 @@ namespace Tests
         [Fact]
         public void SelectManyMultiple_Null()
         {
-            AssertThrows<ArgumentNullException>(() => AsyncEnumerable.SelectMany<int, int>(default(IAsyncEnumerable<int>), AsyncEnumerable.Return(42)));
-            AssertThrows<ArgumentNullException>(() => AsyncEnumerable.SelectMany<int, int>(AsyncEnumerable.Return(42), default(IAsyncEnumerable<int>)));
+            AssertThrows<ArgumentNullException>(() => AsyncEnumerableEx.SelectMany<int, int>(default(IAsyncEnumerable<int>), AsyncEnumerable.Return(42)));
+            AssertThrows<ArgumentNullException>(() => AsyncEnumerableEx.SelectMany<int, int>(AsyncEnumerable.Return(42), default(IAsyncEnumerable<int>)));
         }
 
         [Fact]

+ 21 - 0
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/SelectMany.cs

@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information. 
+
+using System.Collections.Generic;
+
+namespace System.Linq
+{
+    public static partial class AsyncEnumerableEx
+    {
+        public static IAsyncEnumerable<TOther> SelectMany<TSource, TOther>(this IAsyncEnumerable<TSource> source, IAsyncEnumerable<TOther> other)
+        {
+            if (source == null)
+                throw new ArgumentNullException(nameof(source));
+            if (other == null)
+                throw new ArgumentNullException(nameof(other));
+
+            return source.SelectMany(_ => other);
+        }
+    }
+}

+ 0 - 10
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs

@@ -10,16 +10,6 @@ namespace System.Linq
 {
     public static partial class AsyncEnumerable
     {
-        public static IAsyncEnumerable<TOther> SelectMany<TSource, TOther>(this IAsyncEnumerable<TSource> source, IAsyncEnumerable<TOther> other)
-        {
-            if (source == null)
-                throw new ArgumentNullException(nameof(source));
-            if (other == null)
-                throw new ArgumentNullException(nameof(other));
-
-            return source.SelectMany(_ => other);
-        }
-
         public static IAsyncEnumerable<TResult> SelectMany<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, IAsyncEnumerable<TResult>> selector)
         {
             if (source == null)