Bläddra i källkod

Rename Create to CreateEnumerator and CreateEnumerable

Oren Novotny 9 år sedan
förälder
incheckning
ff5f83c29c
32 ändrade filer med 147 tillägg och 154 borttagningar
  1. 3 3
      Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.cs
  2. 2 2
      Ix.NET/Source/System.Interactive.Async/Buffer.cs
  3. 4 4
      Ix.NET/Source/System.Interactive.Async/Catch.cs
  4. 4 4
      Ix.NET/Source/System.Interactive.Async/Concatenate.cs
  5. 52 59
      Ix.NET/Source/System.Interactive.Async/Create.cs
  6. 2 2
      Ix.NET/Source/System.Interactive.Async/DefaultIfEmpty.cs
  7. 1 1
      Ix.NET/Source/System.Interactive.Async/Defer.cs
  8. 2 2
      Ix.NET/Source/System.Interactive.Async/Distinct.cs
  9. 2 2
      Ix.NET/Source/System.Interactive.Async/Do.cs
  10. 2 2
      Ix.NET/Source/System.Interactive.Async/Except.cs
  11. 2 2
      Ix.NET/Source/System.Interactive.Async/Expand.cs
  12. 2 2
      Ix.NET/Source/System.Interactive.Async/Finally.cs
  13. 2 2
      Ix.NET/Source/System.Interactive.Async/Generate.cs
  14. 3 3
      Ix.NET/Source/System.Interactive.Async/Grouping.cs
  15. 2 2
      Ix.NET/Source/System.Interactive.Async/IgnoreElements.cs
  16. 2 2
      Ix.NET/Source/System.Interactive.Async/Intersect.cs
  17. 2 2
      Ix.NET/Source/System.Interactive.Async/Join.cs
  18. 2 2
      Ix.NET/Source/System.Interactive.Async/OnErrorResumeNext.cs
  19. 4 4
      Ix.NET/Source/System.Interactive.Async/OrderBy.cs
  20. 6 6
      Ix.NET/Source/System.Interactive.Async/Repeat.cs
  21. 3 3
      Ix.NET/Source/System.Interactive.Async/Reverse.cs
  22. 4 4
      Ix.NET/Source/System.Interactive.Async/Scan.cs
  23. 4 4
      Ix.NET/Source/System.Interactive.Async/Select.cs
  24. 4 4
      Ix.NET/Source/System.Interactive.Async/SelectMany.cs
  25. 8 8
      Ix.NET/Source/System.Interactive.Async/Skip.cs
  26. 8 8
      Ix.NET/Source/System.Interactive.Async/Take.cs
  27. 4 4
      Ix.NET/Source/System.Interactive.Async/ToAsyncEnumerable.cs
  28. 2 2
      Ix.NET/Source/System.Interactive.Async/ToObservable.cs
  29. 2 2
      Ix.NET/Source/System.Interactive.Async/Using.cs
  30. 4 4
      Ix.NET/Source/System.Interactive.Async/Where.cs
  31. 2 2
      Ix.NET/Source/System.Interactive.Async/Zip.cs
  32. 1 1
      Ix.NET/Source/Tests/Tests.Qbservable.cs

+ 3 - 3
Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.cs

@@ -22,7 +22,7 @@ namespace System.Linq
 
         public static IAsyncEnumerable<TValue> Empty<TValue>()
         {
-            return Create(() => Create<TValue>(
+            return CreateEnumerable(() => CreateEnumerator<TValue>(
                               ct => TaskExt.False,
                               () => { throw new InvalidOperationException(); },
                               () => { })
@@ -47,7 +47,7 @@ namespace System.Linq
 
         public static IAsyncEnumerable<TValue> Never<TValue>()
         {
-            return Create(() => Create<TValue>(
+            return CreateEnumerable(() => CreateEnumerator<TValue>(
                               (ct, tcs) => tcs.Task,
                               () => { throw new InvalidOperationException(); },
                               () => { })
@@ -65,7 +65,7 @@ namespace System.Linq
             if (exception == null)
                 throw new ArgumentNullException(nameof(exception));
 
-            return Create(() => Create<TValue>(
+            return CreateEnumerable(() => CreateEnumerator<TValue>(
                               ct => TaskExt.Throw<bool>(exception),
                               () => { throw new InvalidOperationException(); },
                               () => { })

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Buffer.cs

@@ -36,7 +36,7 @@ namespace System.Linq
 
         private static IAsyncEnumerable<IList<TSource>> Buffer_<TSource>(this IAsyncEnumerable<TSource> source, int count, int skip)
         {
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -89,7 +89,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/Catch.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             if (handler == null)
                 throw new ArgumentNullException(nameof(handler));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
             {
                 var e = source.GetEnumerator();
 
@@ -58,7 +58,7 @@ namespace System.Linq
                                   .ConfigureAwait(false);
                 };
 
-                return Create(
+                return CreateEnumerator(
                     f,
                     () => e.Current,
                     d.Dispose,
@@ -95,7 +95,7 @@ namespace System.Linq
 
         private static IAsyncEnumerable<TSource> Catch_<TSource>(this IEnumerable<IAsyncEnumerable<TSource>> sources)
         {
-            return Create(() =>
+            return CreateEnumerable(() =>
             {
                 var se = sources.GetEnumerator();
                 var e = default(IAsyncEnumerator<TSource>);
@@ -141,7 +141,7 @@ namespace System.Linq
                     }
                 };
 
-                return Create(
+                return CreateEnumerator(
                     f,
                     () => e.Current,
                     d.Dispose,

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/Concatenate.cs

@@ -19,7 +19,7 @@ namespace System.Linq
             if (second == null)
                 throw new ArgumentNullException(nameof(second));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var switched = false;
                               var e = first.GetEnumerator();
@@ -52,7 +52,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => e.Current,
                                   d.Dispose,
@@ -79,7 +79,7 @@ namespace System.Linq
 
         private static IAsyncEnumerable<TSource> Concat_<TSource>(this IEnumerable<IAsyncEnumerable<TSource>> sources)
         {
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var se = sources.GetEnumerator();
                               var e = default(IAsyncEnumerator<TSource>);
@@ -118,7 +118,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => e.Current,
                                   d.Dispose,

+ 52 - 59
Ix.NET/Source/System.Interactive.Async/Create.cs

@@ -1,6 +1,7 @@
 // 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;
 using System.Collections.Generic;
 using System.Linq;
@@ -11,57 +12,43 @@ namespace System.Linq
 {
     public static partial class AsyncEnumerable
     {
-        public static IAsyncEnumerable<T> Create<T>(Func<IAsyncEnumerator<T>> getEnumerator)
+        public static IAsyncEnumerable<T> CreateEnumerable<T>(Func<IAsyncEnumerator<T>> getEnumerator)
         {
             return new AnonymousAsyncEnumerable<T>(getEnumerator);
         }
 
-        private class AnonymousAsyncEnumerable<T> : IAsyncEnumerable<T>
+        public static IAsyncEnumerator<T> CreateEnumerator<T>(Func<CancellationToken, Task<bool>> moveNext, Func<T> current, Action dispose)
         {
-            private Func<IAsyncEnumerator<T>> getEnumerator;
-
-            public AnonymousAsyncEnumerable(Func<IAsyncEnumerator<T>> getEnumerator)
-            {
-                this.getEnumerator = getEnumerator;
-            }
-
-            public IAsyncEnumerator<T> GetEnumerator()
-            {
-                return getEnumerator();
-            }
-        }
-
-        private static IAsyncEnumerator<T> Create<T>(Func<CancellationToken, Task<bool>> moveNext, Func<T> current,
-            Action dispose, IDisposable enumerator)
-        {
-            return Create(async ct =>
-            {
-                using (ct.Register(dispose))
-                {
-                    try
-                    {
-                        var result = await moveNext(ct).ConfigureAwait(false);
-                        if (!result)
-                        {
-                            enumerator?.Dispose();
-                        }
-                        return result;
-                    }
-                    catch
-                    {
-                        enumerator?.Dispose();
-                        throw;
-                    }
-                }
-            }, current, dispose);
+            return new AnonymousAsyncEnumerator<T>(moveNext, current, dispose);
         }
 
-        public static IAsyncEnumerator<T> Create<T>(Func<CancellationToken, Task<bool>> moveNext, Func<T> current, Action dispose)
+        private static IAsyncEnumerator<T> CreateEnumerator<T>(Func<CancellationToken, Task<bool>> moveNext, Func<T> current,
+                                                               Action dispose, IDisposable enumerator)
         {
-            return new AnonymousAsyncEnumerator<T>(moveNext, current, dispose);
+            return CreateEnumerator(async ct =>
+                                    {
+                                        using (ct.Register(dispose))
+                                        {
+                                            try
+                                            {
+                                                var result = await moveNext(ct)
+                                                                 .ConfigureAwait(false);
+                                                if (!result)
+                                                {
+                                                    enumerator?.Dispose();
+                                                }
+                                                return result;
+                                            }
+                                            catch
+                                            {
+                                                enumerator?.Dispose();
+                                                throw;
+                                            }
+                                        }
+                                    }, current, dispose);
         }
 
-        private static IAsyncEnumerator<T> Create<T>(Func<CancellationToken, TaskCompletionSource<bool>, Task<bool>> moveNext, Func<T> current, Action dispose)
+        private static IAsyncEnumerator<T> CreateEnumerator<T>(Func<CancellationToken, TaskCompletionSource<bool>, Task<bool>> moveNext, Func<T> current, Action dispose)
         {
             var self = default(IAsyncEnumerator<T>);
             self = new AnonymousAsyncEnumerator<T>(
@@ -70,14 +57,15 @@ namespace System.Linq
                     var tcs = new TaskCompletionSource<bool>();
 
                     var stop = new Action(() =>
-                    {
-                        self.Dispose();
-                        tcs.TrySetCanceled();
-                    });
+                                          {
+                                              self.Dispose();
+                                              tcs.TrySetCanceled();
+                                          });
 
                     using (ct.Register(stop))
                     {
-                        return await moveNext(ct, tcs).ConfigureAwait(false);
+                        return await moveNext(ct, tcs)
+                                   .ConfigureAwait(false);
                     }
                 },
                 current,
@@ -86,11 +74,26 @@ namespace System.Linq
             return self;
         }
 
+        private class AnonymousAsyncEnumerable<T> : IAsyncEnumerable<T>
+        {
+            private readonly Func<IAsyncEnumerator<T>> getEnumerator;
+
+            public AnonymousAsyncEnumerable(Func<IAsyncEnumerator<T>> getEnumerator)
+            {
+                this.getEnumerator = getEnumerator;
+            }
+
+            public IAsyncEnumerator<T> GetEnumerator()
+            {
+                return getEnumerator();
+            }
+        }
+
         private class AnonymousAsyncEnumerator<T> : IAsyncEnumerator<T>
         {
-            private readonly Func<CancellationToken, Task<bool>> _moveNext;
             private readonly Func<T> _current;
             private readonly Action _dispose;
+            private readonly Func<CancellationToken, Task<bool>> _moveNext;
             private bool _disposed;
 
             public AnonymousAsyncEnumerator(Func<CancellationToken, Task<bool>> moveNext, Func<T> current, Action dispose)
@@ -110,10 +113,7 @@ namespace System.Linq
 
             public T Current
             {
-                get
-                {
-                    return _current();
-                }
+                get { return _current(); }
             }
 
             public void Dispose()
@@ -125,12 +125,5 @@ namespace System.Linq
                 }
             }
         }
-
-
-
-
-      
-
-
     }
-}
+}

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/DefaultIfEmpty.cs

@@ -17,7 +17,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var done = false;
                               var hasElements = false;
@@ -48,7 +48,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,

+ 1 - 1
Ix.NET/Source/System.Interactive.Async/Defer.cs

@@ -16,7 +16,7 @@ namespace System.Linq
             if (factory == null)
                 throw new ArgumentNullException(nameof(factory));
 
-            return Create(() => factory()
+            return CreateEnumerable(() => factory()
                               .GetEnumerator());
         }
     }

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Distinct.cs

@@ -102,7 +102,7 @@ namespace System.Linq
 
         private static IAsyncEnumerable<TSource> DistinctUntilChanged_<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
         {
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -144,7 +144,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Do.cs

@@ -72,7 +72,7 @@ namespace System.Linq
 
         private static IAsyncEnumerable<TSource> DoHelper<TSource>(this IAsyncEnumerable<TSource> source, Action<TSource> onNext, Action<Exception> onError, Action onCompleted)
         {
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -110,7 +110,7 @@ namespace System.Linq
                                       }
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Except.cs

@@ -31,7 +31,7 @@ namespace System.Linq
             if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = first.GetEnumerator();
 
@@ -57,7 +57,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => e.Current,
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Expand.cs

@@ -19,7 +19,7 @@ namespace System.Linq
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = default(IAsyncEnumerator<TSource>);
 
@@ -64,7 +64,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Finally.cs

@@ -18,7 +18,7 @@ namespace System.Linq
             if (finallyAction == null)
                 throw new ArgumentNullException(nameof(finallyAction));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -26,7 +26,7 @@ namespace System.Linq
                               var r = new Disposable(finallyAction);
                               var d = Disposable.Create(cts, e, r);
 
-                              return Create(
+                              return CreateEnumerator(
                                   ct => e.MoveNext(ct),
                                   () => e.Current,
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Generate.cs

@@ -20,13 +20,13 @@ namespace System.Linq
             if (resultSelector == null)
                 throw new ArgumentNullException(nameof(resultSelector));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var i = initialState;
                               var started = false;
                               var current = default(TResult);
 
-                              return Create(
+                              return CreateEnumerator(
                                   ct =>
                                   {
                                       var b = false;

+ 3 - 3
Ix.NET/Source/System.Interactive.Async/Grouping.cs

@@ -25,7 +25,7 @@ namespace System.Linq
             if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var gate = new object();
 
@@ -139,7 +139,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,
@@ -306,7 +306,7 @@ namespace System.Linq
                         return false;
                     };
 
-                return Create(
+                return CreateEnumerator(
                     ct =>
                     {
                         ++index;

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/IgnoreElements.cs

@@ -17,7 +17,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -37,7 +37,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create<TSource>(
+                              return CreateEnumerator<TSource>(
                                   f,
                                   () => { throw new InvalidOperationException(); },
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Intersect.cs

@@ -21,7 +21,7 @@ namespace System.Linq
             if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = first.GetEnumerator();
 
@@ -54,7 +54,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => e.Current,
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Join.cs

@@ -27,7 +27,7 @@ namespace System.Linq
             if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));
 
-            return Create(
+            return CreateEnumerable(
                 () =>
                 {
                     var oe = outer.GetEnumerator();
@@ -147,7 +147,7 @@ namespace System.Linq
                                        .ConfigureAwait(false);
                         };
 
-                    return Create(
+                    return CreateEnumerator(
                         f,
                         () => current,
                         d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/OnErrorResumeNext.cs

@@ -40,7 +40,7 @@ namespace System.Linq
 
         private static IAsyncEnumerable<TSource> OnErrorResumeNext_<TSource>(IEnumerable<IAsyncEnumerable<TSource>> sources)
         {
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var se = sources.GetEnumerator();
                               var e = default(IAsyncEnumerator<TSource>);
@@ -85,7 +85,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => e.Current,
                                   d.Dispose,

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/OrderBy.cs

@@ -22,11 +22,11 @@ namespace System.Linq
                 throw new ArgumentNullException(nameof(comparer));
 
             return new OrderedAsyncEnumerable<TSource, TKey>(
-                Create(() =>
+                CreateEnumerable(() =>
                        {
                            var current = default(IEnumerable<TSource>);
 
-                           return Create(
+                           return CreateEnumerator(
                                async ct =>
                                {
                                    if (current == null)
@@ -152,7 +152,7 @@ namespace System.Linq
 
             private IAsyncEnumerable<IEnumerable<T>> Classes()
             {
-                return Create(() =>
+                return CreateEnumerable(() =>
                               {
                                   var e = equivalenceClasses.GetEnumerator();
                                   var list = new List<IEnumerable<T>>();
@@ -182,7 +182,7 @@ namespace System.Linq
                                           return e1.MoveNext();
                                       };
 
-                                  return Create(
+                                  return CreateEnumerator(
                                       async ct =>
                                       {
                                           if (e1 != null)

+ 6 - 6
Ix.NET/Source/System.Interactive.Async/Repeat.cs

@@ -23,9 +23,9 @@ namespace System.Linq
 
         public static IAsyncEnumerable<TResult> Repeat<TResult>(TResult element)
         {
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
-                              return Create(
+                              return CreateEnumerator(
                                   ct => TaskExt.True,
                                   () => element,
                                   () => { }
@@ -41,7 +41,7 @@ namespace System.Linq
             if (count < 0)
                 throw new ArgumentOutOfRangeException(nameof(count));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = default(IAsyncEnumerator<TSource>);
                               var a = new AssignableDisposable();
@@ -77,7 +77,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,
@@ -91,7 +91,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = default(IAsyncEnumerator<TSource>);
                               var a = new AssignableDisposable();
@@ -121,7 +121,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,

+ 3 - 3
Ix.NET/Source/System.Interactive.Async/Reverse.cs

@@ -16,7 +16,7 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var stack = default(Stack<TSource>);
@@ -24,12 +24,12 @@ namespace System.Linq
                               var cts = new CancellationTokenDisposable();
                               var d = Disposable.Create(cts, e);
 
-                              return Create(
+                              return CreateEnumerator(
                                   async ct =>
                                   {
                                       if (stack == null)
                                       {
-                                          stack = await Create(() => e)
+                                          stack = await CreateEnumerable(() => e)
                                                       .Aggregate(new Stack<TSource>(), (s, x) =>
                                                                                        {
                                                                                            s.Push(x);

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/Scan.cs

@@ -19,7 +19,7 @@ namespace System.Linq
             if (accumulator == null)
                 throw new ArgumentNullException(nameof(accumulator));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -45,7 +45,7 @@ namespace System.Linq
                                       return true;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,
@@ -61,7 +61,7 @@ namespace System.Linq
             if (accumulator == null)
                 throw new ArgumentNullException(nameof(accumulator));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -97,7 +97,7 @@ namespace System.Linq
                                       return true;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/Select.cs

@@ -18,7 +18,7 @@ namespace System.Linq
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var current = default(TResult);
@@ -26,7 +26,7 @@ namespace System.Linq
                               var cts = new CancellationTokenDisposable();
                               var d = Disposable.Create(cts, e);
 
-                              return Create(
+                              return CreateEnumerator(
                                   async ct =>
                                   {
                                       if (await e.MoveNext(cts.Token)
@@ -51,7 +51,7 @@ namespace System.Linq
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var current = default(TResult);
@@ -60,7 +60,7 @@ namespace System.Linq
                               var cts = new CancellationTokenDisposable();
                               var d = Disposable.Create(cts, e);
 
-                              return Create(
+                              return CreateEnumerator(
                                   async ct =>
                                   {
                                       if (await e.MoveNext(cts.Token)

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/SelectMany.cs

@@ -30,7 +30,7 @@ namespace System.Linq
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var ie = default(IAsyncEnumerator<TResult>);
@@ -70,7 +70,7 @@ namespace System.Linq
                                           return false;
                                       };
 
-                              return Create(ct => ie == null ? outer(cts.Token) : inner(cts.Token),
+                              return CreateEnumerator(ct => ie == null ? outer(cts.Token) : inner(cts.Token),
                                             () => ie.Current,
                                             d.Dispose,
                                             e
@@ -85,7 +85,7 @@ namespace System.Linq
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var ie = default(IAsyncEnumerator<TResult>);
@@ -127,7 +127,7 @@ namespace System.Linq
                                           return false;
                                       };
 
-                              return Create(ct => ie == null ? outer(cts.Token) : inner(cts.Token),
+                              return CreateEnumerator(ct => ie == null ? outer(cts.Token) : inner(cts.Token),
                                             () => ie.Current,
                                             d.Dispose,
                                             e

+ 8 - 8
Ix.NET/Source/System.Interactive.Async/Skip.cs

@@ -19,7 +19,7 @@ namespace System.Linq
             if (count < 0)
                 throw new ArgumentOutOfRangeException(nameof(count));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var n = count;
@@ -45,7 +45,7 @@ namespace System.Linq
                                                  .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   ct => f(cts.Token),
                                   () => e.Current,
                                   d.Dispose,
@@ -61,7 +61,7 @@ namespace System.Linq
             if (count < 0)
                 throw new ArgumentOutOfRangeException(nameof(count));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -91,7 +91,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,
@@ -107,7 +107,7 @@ namespace System.Linq
             if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var skipping = true;
@@ -135,7 +135,7 @@ namespace System.Linq
                                                     .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => e.Current,
                                   d.Dispose,
@@ -151,7 +151,7 @@ namespace System.Linq
             if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var skipping = true;
@@ -180,7 +180,7 @@ namespace System.Linq
                                                     .ConfigureAwait(false);
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => e.Current,
                                   d.Dispose,

+ 8 - 8
Ix.NET/Source/System.Interactive.Async/Take.cs

@@ -19,7 +19,7 @@ namespace System.Linq
             if (count < 0)
                 throw new ArgumentOutOfRangeException(nameof(count));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var n = count;
@@ -27,7 +27,7 @@ namespace System.Linq
                               var cts = new CancellationTokenDisposable();
                               var d = Disposable.Create(cts, e);
 
-                              return Create(
+                              return CreateEnumerator(
                                   async ct =>
                                   {
                                       if (n == 0)
@@ -57,7 +57,7 @@ namespace System.Linq
             if (count < 0)
                 throw new ArgumentOutOfRangeException(nameof(count));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -101,7 +101,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   f,
                                   () => current,
                                   d.Dispose,
@@ -117,14 +117,14 @@ namespace System.Linq
             if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
                               var cts = new CancellationTokenDisposable();
                               var d = Disposable.Create(cts, e);
 
-                              return Create(
+                              return CreateEnumerator(
                                   async ct =>
                                   {
                                       if (await e.MoveNext(cts.Token)
@@ -148,7 +148,7 @@ namespace System.Linq
             if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var index = 0;
@@ -156,7 +156,7 @@ namespace System.Linq
                               var cts = new CancellationTokenDisposable();
                               var d = Disposable.Create(cts, e);
 
-                              return Create(
+                              return CreateEnumerator(
                                   async ct =>
                                   {
                                       if (await e.MoveNext(cts.Token)

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/ToAsyncEnumerable.cs

@@ -15,11 +15,11 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
             {
                 var e = source.GetEnumerator();
 
-                return Create(
+                return CreateEnumerator(
                     ct => Task.Run(() =>
                     {
                         var res = false;
@@ -67,12 +67,12 @@ namespace System.Linq
             if (task == null)
                 throw new ArgumentNullException(nameof(task));
             
-            return Create(() =>
+            return CreateEnumerable(() =>
             {
                 var called = 0;
 
                 var value = default(TSource);
-                return Create(
+                return CreateEnumerator(
                     async ct =>
                     {
                         if (Interlocked.CompareExchange(ref called, 1, 0) == 0)

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/ToObservable.cs

@@ -16,13 +16,13 @@ namespace System.Linq
             if (source == null)
                 throw new ArgumentNullException(nameof(source));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var observer = new ToAsyncEnumerableObserver<TSource>();
 
                               var subscription = source.Subscribe(observer);
 
-                              return Create(
+                              return CreateEnumerator(
                                   (ct, tcs) =>
                                   {
                                       var hasValue = false;

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Using.cs

@@ -18,7 +18,7 @@ namespace System.Linq
             if (enumerableFactory == null)
                 throw new ArgumentNullException(nameof(enumerableFactory));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var resource = resourceFactory();
                               var e = default(IAsyncEnumerator<TSource>);
@@ -39,7 +39,7 @@ namespace System.Linq
 
                               var current = default(TSource);
 
-                              return Create(
+                              return CreateEnumerator(
                                   async ct =>
                                   {
                                       bool res;

+ 4 - 4
Ix.NET/Source/System.Interactive.Async/Where.cs

@@ -19,7 +19,7 @@ namespace System.Linq
             if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
 
@@ -40,7 +40,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   ct => f(cts.Token),
                                   () => e.Current,
                                   d.Dispose,
@@ -56,7 +56,7 @@ namespace System.Linq
             if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e = source.GetEnumerator();
                               var index = 0;
@@ -78,7 +78,7 @@ namespace System.Linq
                                       return false;
                                   };
 
-                              return Create(
+                              return CreateEnumerator(
                                   ct => f(cts.Token),
                                   () => e.Current,
                                   d.Dispose,

+ 2 - 2
Ix.NET/Source/System.Interactive.Async/Zip.cs

@@ -20,7 +20,7 @@ namespace System.Linq
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
 
-            return Create(() =>
+            return CreateEnumerable(() =>
                           {
                               var e1 = first.GetEnumerator();
                               var e2 = second.GetEnumerator();
@@ -29,7 +29,7 @@ namespace System.Linq
                               var cts = new CancellationTokenDisposable();
                               var d = Disposable.Create(cts, e1, e2);
 
-                              return Create(
+                              return CreateEnumerator(
                                   ct => e1.MoveNext(cts.Token)
                                           .Zip(e2.MoveNext(cts.Token), (f, s) =>
                                                                        {

+ 1 - 1
Ix.NET/Source/Tests/Tests.Qbservable.cs

@@ -63,7 +63,7 @@ namespace Tests
                     .Select(m => GetSignature(m, true))
                     .OrderBy(x => x).ToList();
 
-                if (!group.Name.Equals("Create"))
+                if (!(group.Name.Equals("CreateEnumerable") || group.Name.Equals("CreateEnumerator")))
                     Assert.True(oss.SequenceEqual(qss), "Mismatch between QueryableEx and EnumerableEx for " + group.Name);
             }
         }