diff --git a/Ix.NET/Documentation/adr/0002-System-Linq-Async-In-Net10.md b/Ix.NET/Documentation/adr/0002-System-Linq-Async-In-Net10.md new file mode 100644 index 000000000..1e33bb2f4 --- /dev/null +++ b/Ix.NET/Documentation/adr/0002-System-Linq-Async-In-Net10.md @@ -0,0 +1,50 @@ +# Migration of core `IAsyncEnumerable` LINQ to runtime libraries + +.NET 10.0 provides LINQ support for `IAsyncEnumerable` in the runtime class libraries. This effectively renders most of `System.Linq.Async` irrelevant. However, enabling a smooth transition to .NET 10.0 for existing users of this library is not entirely straightforward. This document describes how this will work. + +## Status + +Proposed. + +## Authors + +@idg10 ([Ian Griffiths](https://endjin.com/who-we-are/our-people/ian-griffiths/)) + + +## Context + +As an accident of history, the Rx.NET repository ended up being the de facto implementation of LINQ for `IAsyncEnumerable` from 2019 when .NET Core 3 shipped up until late 2025 when .NET 10 shipped. + +This happened because Rx.NET had effectively been the incubator in which `IAsyncEnumerable` was originally developed. Back before .NET Core 3.0, there was no such interface built into .NET, but Rx _did_ define this interface as part of its 'interactive extensions for .NET' feature. It also implented common LINQ operators for that interface. + +.NET Core 3.0 defined its own version of this `IAsyncEnumerable`, but the .NET team did not choose to implement LINQ for it. Since the Rx.NET repository already had a fairly complete implentation of LINQ for its original version of `IAsyncEnumerable`, it took only a fairly small amount of work to adapt this to the new version of `IAsyncEnumerable` built into .NET. Thus `System.Linq.Async` was born. + +In .NET 10.0, the .NET team decided to take ownership of this functionality. For various reasons they did not simply adopt the existing code. (One reason is that .NET class library design guidelines have evolved over time, and some of the methods in Rx's `System.Linq.Async` did not align with those guidelines.) So the .NET team took the decision that they were not going to maintain backwards compatibility with the existing Rx.NET-originated `System.Linq.Async` library. Instead, there is a new `System.Linq.AsyncEnumerable` library that defines equivalent functionality, but implemented from scratch, and fully in conformance with current .NET class library design guidelines. + +Most of the API changes fall into one of these categories: + +1. Where `System.Linq.Async` defined methods taking an `IComparer` and an associated overload without the `IComparer`, `System.Linq.AsyncEnumerable` only defines the overload that takes the `IComparer`, making it optional with a default value of `null` +2. For certain operators (e.g. min, max, sum) `System.Linq.Async` defined methods operating directly on numerical sequences, and also ones that operate on sequences of any type, taking an addition argument to project each element to a numeric value; in `System.Linq.AsyncEnumerable`, these projection-based variants either have a different name (e.g. `MaxByAsync`) or simply don't exist (as with `SumAsync`) +3. `System.Linq.Async` offered some adapters (`ToEnumerable`, `ToObservable`) that handled async operations in potentially risky ways (sync over async, or fire-and-forget respectively); `System.Linq.AsyncEnumerable` has chosen simply not to implement these at all + +There are also a couple of cases where functionality simply has not been reproduced. `System.Linq.Async` provides an `AsAsyncEnumerable` to enable deliberate type erasure. TBD. + + +## Decision + +The next `System.Linq.Async` release will: + +1. add a reference to `System.Linq.AsyncEnumerable` +2. remove from publicly visible API (ref assemblies) all `IAsyncEnumerable` extension methods for which direct replacements exist +3. add [Obsolete] attribute for all remaining members of `AsyncEnumerable` +4. mark `IAsyncGrouping` as obsolete +5. TBD `IAsyncIListProvider` relocate? +6. continue to provide the full API in the `lib` assemblies to provide binary compatibility + +Note that not all of the XxxAwaitAsync and XxxAwaitWithCancellationAsync are handled the same way. In some cases, these now have replacements. E.g. System.Linq.AsyncEnumerable replaces AggregateAwaitAsync with an overload of AggregateAsync. So System.Linq.Async's ref assembly continues to make AggregateAwaitAsync available but marks it as Obsolete, telling you to use AggregateAsync instead. But there are some methods for which no replacement exists. We move these into System.Interactive.Async, because that's where `IAsyncEnumerable` features that have no equivalents in the .NET runtime libraries live. E.g., although `System.Linq.AsyncEnumerable` defines `AverageAsync`, it does not offer the same range of functionality as `System.Linq.Async` previously did: overloads taking selectors (both sync and async). These methods become hidden in `System.Linq.Async` (available only for binary compatibility) and they have moved to `AsyncEnumerableEx` in `System.Interactive.Async`, and `System.Linq.Async` now adds a transitive reference to `System.Interactive.Async` in order to ensure continued source compatibility until such time as people update their NuGet references. + +combinations: + +* Method hidden in ref, available in `System.Linq.AsyncEnumerable` +* Method hidden in ref, available in `System.Interactive.Async` +* Method visible but marked as `Obsolete` \ No newline at end of file diff --git a/Ix.NET/Source/ApiCompare/ApiCompare.csproj b/Ix.NET/Source/ApiCompare/ApiCompare.csproj index 174cbcc1f..905863c51 100644 --- a/Ix.NET/Source/ApiCompare/ApiCompare.csproj +++ b/Ix.NET/Source/ApiCompare/ApiCompare.csproj @@ -5,6 +5,20 @@ net8.0 + + + + + + + + + SystemLinqAsyncEnumerable + + + + diff --git a/Ix.NET/Source/Benchmarks.System.Interactive/Benchmarks.System.Interactive.csproj b/Ix.NET/Source/Benchmarks.System.Interactive/Benchmarks.System.Interactive.csproj index 90a39816c..748770549 100644 --- a/Ix.NET/Source/Benchmarks.System.Interactive/Benchmarks.System.Interactive.csproj +++ b/Ix.NET/Source/Benchmarks.System.Interactive/Benchmarks.System.Interactive.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 true Current Sources;Ix.net 3.1.1;Ix.net 3.2 diff --git a/Ix.NET/Source/FasterLinq/FasterLinq.csproj b/Ix.NET/Source/FasterLinq/FasterLinq.csproj index 8735c4467..5758ba8fc 100644 --- a/Ix.NET/Source/FasterLinq/FasterLinq.csproj +++ b/Ix.NET/Source/FasterLinq/FasterLinq.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 $(NoWarn);IDE0007;IDE0034;IDE0040;IDE0063;IDE0090;IDE1006 diff --git a/Ix.NET/Source/Playground/Playground.csproj b/Ix.NET/Source/Playground/Playground.csproj index 174cbcc1f..7396a7ba8 100644 --- a/Ix.NET/Source/Playground/Playground.csproj +++ b/Ix.NET/Source/Playground/Playground.csproj @@ -14,4 +14,22 @@ + + + + + + + + + + SystemLinqAsyncEnumerable + + + diff --git a/Ix.NET/Source/System.Interactive.Async.Providers.Tests/System.Interactive.Async.Providers.Tests.csproj b/Ix.NET/Source/System.Interactive.Async.Providers.Tests/System.Interactive.Async.Providers.Tests.csproj index 0f4fbb98c..3d26121a3 100644 --- a/Ix.NET/Source/System.Interactive.Async.Providers.Tests/System.Interactive.Async.Providers.Tests.csproj +++ b/Ix.NET/Source/System.Interactive.Async.Providers.Tests/System.Interactive.Async.Providers.Tests.csproj @@ -1,7 +1,7 @@  - net48;net8.0;net6.0 + net48;net10.0;net8.0 $(NoWarn);CS0618 @@ -15,6 +15,25 @@ + + + + + + + + + + + SystemLinqAsyncEnumerable + + + diff --git a/Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj b/Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj index 5e214f941..aeafce882 100644 --- a/Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj +++ b/Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj @@ -3,7 +3,7 @@ Interactive Extensions Async Providers Library used to build query providers and express queries over async enumerable sequences. Interactive Extensions - Async Providers Library - net48;netstandard2.0;netstandard2.1;net6.0 + net48;netstandard2.0;netstandard2.1;net8.0 Ix;Interactive;Extensions;Enumerable;Asynchronous diff --git a/Ix.NET/Source/System.Interactive.Async.Tests/System.Interactive.Async.Tests.csproj b/Ix.NET/Source/System.Interactive.Async.Tests/System.Interactive.Async.Tests.csproj index 99ef36d68..90dfd4327 100644 --- a/Ix.NET/Source/System.Interactive.Async.Tests/System.Interactive.Async.Tests.csproj +++ b/Ix.NET/Source/System.Interactive.Async.Tests/System.Interactive.Async.Tests.csproj @@ -1,7 +1,7 @@  - net48;net8.0;net6.0 + net48;net10.0;net8.0 + + + + + + + + + SystemLinqAsyncEnumerable + + + diff --git a/Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.csproj b/Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.csproj index aa02a1e92..2270a5232 100644 --- a/Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.csproj +++ b/Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.csproj @@ -3,7 +3,7 @@ Interactive Extensions Async Library used to express queries over asynchronous enumerable sequences. Interactive Extensions - Async Library - net48;netstandard2.0;netstandard2.1;net6.0 + net48;netstandard2.0;netstandard2.1;net8.0 Ix;Interactive;Extensions;Enumerable;Asynchronous @@ -24,8 +24,31 @@ + + + + + + + + + + + Average.Generated.tt + True + True + + + + + + Average.Generated.cs + TextTemplatingFileGenerator + + + - + - + diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/IAsyncIListProvider.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/IAsyncIListProvider.cs new file mode 100644 index 000000000..717dce945 --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/IAsyncIListProvider.cs @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace System.Linq +{ + /// + /// An iterator that can produce an array or through an optimized path. + /// + /// + /// This interface is primarily used for internal purposes as an optimization for LINQ operators. Its use is discouraged. + /// It was made public because it was originally defined in the System.Linq.Async package but also used in + /// System.Interactive.Async. Now that System.Linq.Async is being retired in favor of .NET 10.0's + /// System.Linq.AsyncEnumerable, the System.Interactive.Async package no longer takes a dependency on + /// System.Linq.Async, which is why it now defines its own version of this interface here. We can't put a type + /// forwarder in System.Interactive.Async to here because that would risk creating a circular dependency in + /// cases where an application managed to get out-of-sync versions of the two packages, so this interface is not + /// backwards compatible with the old one. If you were implementing this in your own types to get the associated + /// optimizations, be aware that this is not supported, but implementing this copy of the interface (in place of + /// the old version defined in the deprecated System.Linq.Async package) will continue to provide the + /// same (unsupported) behaviour. + /// + internal interface IAsyncIListProvider : IAsyncEnumerable + { + /// + /// Produce an array of the sequence through an optimized path. + /// + /// + /// The array. + ValueTask ToArrayAsync(CancellationToken cancellationToken); + + /// + /// Produce a of the sequence through an optimized path. + /// + /// + /// The . + ValueTask> ToListAsync(CancellationToken cancellationToken); + + /// + /// Returns the count of elements in the sequence. + /// + /// If true then the count should only be calculated if doing + /// so is quick (sure or likely to be constant time), otherwise -1 should be returned. + /// + /// The number of elements. + ValueTask GetCountAsync(bool onlyIfCheap, CancellationToken cancellationToken); + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/AsAsyncEnumerable.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/AsAsyncEnumerable.cs new file mode 100644 index 000000000..8a5eb3af7 --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/AsAsyncEnumerable.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; + +namespace System.Linq +{ + public static partial class AsyncEnumerableEx + { + // NB: Synchronous LINQ to Objects doesn't hide the implementation of the source either. + + // Note: this was previously in System.Linq.Async, but since .NET 10.0's System.Linq.AsyncEnumerable chose not to + // implement it (even though Enumerable.AsEnumerable exists), we moved it into System.Interactive.Async so that + // it remains available even after developers remove their dependency on the deprecated System.Linq.Async. + + /// + /// Hides the identity of an async-enumerable sequence. + /// + /// The type of the elements in the source sequence. + /// An async-enumerable sequence whose identity to hide. + /// An async-enumerable sequence that hides the identity of the source sequence. + /// is null. + public static IAsyncEnumerable AsAsyncEnumerable(this IAsyncEnumerable source) => source; + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Average.Generated.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Average.Generated.cs new file mode 100644 index 000000000..cb32b4639 --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Average.Generated.cs @@ -0,0 +1,514 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace System.Linq +{ + public static partial class AsyncEnumerableEx + { + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + if (!await e.MoveNextAsync()) + { + throw Error.NoElements(); + } + + long sum = selector(e.Current); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + ++count; + } + } + + return (double)sum / count; + } + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + if (!await e.MoveNextAsync()) + { + throw Error.NoElements(); + } + + long sum = selector(e.Current); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + ++count; + } + } + + return (double)sum / count; + } + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + if (!await e.MoveNextAsync()) + { + throw Error.NoElements(); + } + + double sum = selector(e.Current); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + ++count; + } + } + + return (float)(sum / count); + } + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + if (!await e.MoveNextAsync()) + { + throw Error.NoElements(); + } + + double sum = selector(e.Current); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + ++count; + } + } + + return sum / count; + } + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + if (!await e.MoveNextAsync()) + { + throw Error.NoElements(); + } + + decimal sum = selector(e.Current); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + ++count; + } + } + + return sum / count; + } + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + long sum = v.GetValueOrDefault(); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + v = selector(e.Current); + if (v.HasValue) + { + sum += v.GetValueOrDefault(); + ++count; + } + } + } + + return (double)sum / count; + } + } + } + + return null; + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + long sum = v.GetValueOrDefault(); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + v = selector(e.Current); + if (v.HasValue) + { + sum += v.GetValueOrDefault(); + ++count; + } + } + } + + return (double)sum / count; + } + } + } + + return null; + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + double sum = v.GetValueOrDefault(); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + v = selector(e.Current); + if (v.HasValue) + { + sum += v.GetValueOrDefault(); + ++count; + } + } + } + + return (float)(sum / count); + } + } + } + + return null; + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + double sum = v.GetValueOrDefault(); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + v = selector(e.Current); + if (v.HasValue) + { + sum += v.GetValueOrDefault(); + ++count; + } + } + } + + return sum / count; + } + } + } + + return null; + } + } + + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask AverageAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask Core(IAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + decimal sum = v.GetValueOrDefault(); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + v = selector(e.Current); + if (v.HasValue) + { + sum += v.GetValueOrDefault(); + ++count; + } + } + } + + return sum / count; + } + } + } + + return null; + } + } + + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Average.Generated.tt b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Average.Generated.tt new file mode 100644 index 000000000..7ab5cfa74 --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Average.Generated.tt @@ -0,0 +1,155 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace System.Linq +{ +<# +// Although .NET 10.0's System.Linq.AsyncEnumerable defines AverageAsync, it is missing some features that were previously defined in System.Linq.Async: +// Overloads of AverageAsync accepting a selector function (e.g. xs.AverageAsync(x => x.Value)) +// The AverageAwaitAsync variants accepting an async selector function returning a ValueTask +// The AverageAwaitWithCancellationAsync variant where an async selector function accepts a CancellationToken +// Since we are deprecating System.Linq.Async, these methods are now available there only in the runtime (lib) assemblies and not the +// ref assemblies. So they are available for binary backwards compatibility, but are not visible during compilation. This is necessary +// to ensure that code now gets the .NET 10 implementations of AverageAsync where available. But we want to enable code that was using +// the functionality that .NET 10 did not replicate to be able to continue to work after removing the reference to System.Linq.Async. +// So we've moved the relevant functionality back into System.Interactive.Async because that has always been the home of LINQ-like +// features for IAsyncEnumerable that aren't part of the core LINQ functionality. +#> + public static partial class AsyncEnumerableEx + { +<# +var os = new[] +{ + new { type = "int", res = "double", sum = "long" }, + new { type = "long", res = "double", sum = "long" }, + new { type = "float", res = "float", sum = "double" }, + new { type = "double", res = "double", sum = "double" }, + new { type = "decimal", res = "decimal", sum = "decimal" }, + new { type = "int?", res = "double?", sum = "long" }, + new { type = "long?", res = "double?", sum = "long" }, + new { type = "float?", res = "float?", sum = "double" }, + new { type = "double?", res = "double?", sum = "double" }, + new { type = "decimal?", res = "decimal?", sum = "decimal" }, +}; + +foreach (var o in os) +{ + var isNullable = o.type.EndsWith("?"); + var t = o.type.TrimEnd('?'); + + string res = ""; + + if (t == "int" || t == "long") + res = "(double)sum / count"; + else if (t == "double" || t == "decimal") + res = "sum / count"; + else if (t == "float") + res = "(float)(sum / count)"; + + var typeStr = o.type; + if (isNullable) { + typeStr = "Nullable{" + o.type.Substring(0, 1).ToUpper() + o.type.Substring(1, o.type.Length - 2) + "}"; + } +#> + + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking a transform function on each element of the input sequence. + /// + /// The type of the elements in the source sequence. + /// A sequence of values to calculate the average of. + /// A transform function to apply to each element. + /// The optional cancellation token to be used for cancelling the sequence at any time. + /// An async-enumerable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. + /// or is null. + /// (Asynchronous) The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + public static ValueTask<<#=o.res#>> AverageAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + if (selector == null) + throw Error.ArgumentNull(nameof(selector)); + + return Core(source, selector, cancellationToken); + + static async ValueTask<<#=o.res#>> Core(IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { +<# +if (isNullable) +{ +#> + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + <#=o.sum#> sum = v.GetValueOrDefault(); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + v = selector(e.Current); + if (v.HasValue) + { + sum += v.GetValueOrDefault(); + ++count; + } + } + } + + return <#=res#>; + } + } + } + + return null; +<# +} +else +{ +#> + await using (var e = source.GetConfiguredAsyncEnumerator(cancellationToken, false)) + { + if (!await e.MoveNextAsync()) + { + throw Error.NoElements(); + } + + <#=o.sum#> sum = selector(e.Current); + long count = 1; + checked + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + ++count; + } + } + + return <#=res#>; + } +<# +} +#> + } + } + +<# +} +#> + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Disposables.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Disposables.cs new file mode 100644 index 000000000..e256e2017 --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Disposables.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Threading; + +namespace System.Linq +{ + internal sealed class CancellationTokenDisposable : IDisposable + { + private readonly CancellationTokenSource _cts = new(); + + public CancellationToken Token => _cts.Token; + + public void Dispose() + { + if (!_cts.IsCancellationRequested) + { + _cts.Cancel(); + } + } + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Scan.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Scan.cs index fa0aca1c1..d839f46c4 100644 --- a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Scan.cs +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Scan.cs @@ -16,7 +16,7 @@ public static partial class AsyncEnumerableEx /// /// Applies an accumulator function over an async-enumerable sequence and returns each intermediate result. - /// For aggregation behavior with no intermediate results, see . + /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence and the result of the aggregation. /// An async-enumerable sequence to accumulate over. @@ -54,7 +54,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// /// Applies an accumulator function over an async-enumerable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. - /// For aggregation behavior with no intermediate results, see . + /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence. /// The type of the result of the aggregation. @@ -87,7 +87,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source /// /// Applies an asynchronous accumulator function over an async-enumerable sequence and returns each intermediate result. - /// For aggregation behavior with no intermediate results, see . + /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence and the result of the aggregation. /// An async-enumerable sequence to accumulate over. @@ -126,7 +126,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION /// /// Applies an asynchronous (cancellable) accumulator function over an async-enumerable sequence and returns each intermediate result. - /// For aggregation behavior with no intermediate results, see . + /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence and the result of the aggregation. /// An async-enumerable sequence to accumulate over. @@ -165,7 +165,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// /// Applies an asynchronous accumulator function over an async-enumerable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. - /// For aggregation behavior with no intermediate results, see . + /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence. /// The type of the result of the aggregation. @@ -199,7 +199,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source #if !NO_DEEP_CANCELLATION /// /// Applies an asynchronous (cancellable) accumulator function over an async-enumerable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. - /// For aggregation behavior with no intermediate results, see . + /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence. /// The type of the result of the aggregation. diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToAsyncEnumerable.Observable.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToAsyncEnumerable.Observable.cs new file mode 100644 index 000000000..5506aeffc --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToAsyncEnumerable.Observable.cs @@ -0,0 +1,222 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace System.Linq +{ + public static partial class AsyncEnumerableEx + { + /// + /// Converts an observable sequence to an async-enumerable sequence. + /// + /// The type of the elements in the source sequence. + /// Observable sequence to convert to an async-enumerable sequence. + /// The async-enumerable sequence whose elements are pulled from the given observable sequence. + /// is null. + public static IAsyncEnumerable ToAsyncEnumerable(this IObservable source) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + + return new ObservableAsyncEnumerable(source); + } + + private sealed class ObservableAsyncEnumerable : AsyncIterator, IObserver + { + private readonly IObservable _source; + + private ConcurrentQueue? _values = new(); + private Exception? _error; + private bool _completed; + private TaskCompletionSource? _signal; + private IDisposable? _subscription; + private CancellationTokenRegistration _ctr; + + public ObservableAsyncEnumerable(IObservable source) => _source = source; + + public override AsyncIteratorBase Clone() => new ObservableAsyncEnumerable(_source); + + public override ValueTask DisposeAsync() + { + Dispose(); + + return base.DisposeAsync(); + } + + protected override async ValueTask MoveNextCore() + { + // + // REVIEW: How often should we check? At the very least, we want to prevent + // subscribing if cancellation is requested. A case may be made to + // check for each iteration, namely because this operator is a bridge + // with another interface. However, we also wire up cancellation to + // the observable subscription, so there's redundancy here. + // + _cancellationToken.ThrowIfCancellationRequested(); + + switch (_state) + { + case AsyncIteratorState.Allocated: + // + // NB: Breaking change to align with lazy nature of async iterators. + // + // In previous implementations, the Subscribe call happened during + // the call to GetAsyncEnumerator. + // + // REVIEW: Confirm this design point. This implementation is compatible + // with an async iterator using "yield return", e.g. subscribing + // to the observable sequence and yielding values out of a local + // queue filled by observer callbacks. However, it departs from + // the dual treatment of Subscribe/GetEnumerator. + // + + _subscription = _source.Subscribe(this); + _ctr = _cancellationToken.Register(OnCanceled, state: null); + _state = AsyncIteratorState.Iterating; + goto case AsyncIteratorState.Iterating; + + case AsyncIteratorState.Iterating: + while (true) + { + var completed = Volatile.Read(ref _completed); + + if (_values!.TryDequeue(out _current!)) + { + return true; + } + else if (completed) + { + var error = _error; + + if (error != null) + { + throw error; + } + + return false; + } + + await Resume().ConfigureAwait(false); + Volatile.Write(ref _signal, null); + } + } + + await DisposeAsync().ConfigureAwait(false); + return false; + } + + public void OnCompleted() + { + Volatile.Write(ref _completed, true); + + DisposeSubscription(); + OnNotification(); + } + + public void OnError(Exception error) + { + _error = error; + Volatile.Write(ref _completed, true); + + DisposeSubscription(); + OnNotification(); + } + + public void OnNext(TSource value) + { + _values?.Enqueue(value); + + OnNotification(); + } + + private void OnNotification() + { + while (true) + { + var signal = Volatile.Read(ref _signal); + + if (signal == TaskExt.True) + { + return; + } + + if (signal != null) + { + signal.TrySetResult(true); + return; + } + + if (Interlocked.CompareExchange(ref _signal, TaskExt.True, null) == null) + { + return; + } + } + } + + private void Dispose() + { + _ctr.Dispose(); + DisposeSubscription(); + + _values = null; + _error = null; + } + + private void DisposeSubscription() => Interlocked.Exchange(ref _subscription, null)?.Dispose(); + + private void OnCanceled(object? state) + { + var cancelledTcs = default(TaskCompletionSource); + + Dispose(); + + while (true) + { + var signal = Volatile.Read(ref _signal); + + if (signal != null) + { + if (signal.TrySetCanceled(_cancellationToken)) + return; + } + + if (cancelledTcs == null) + { + cancelledTcs = new TaskCompletionSource(); + cancelledTcs.TrySetCanceled(_cancellationToken); + } + + if (Interlocked.CompareExchange(ref _signal, cancelledTcs, signal) == signal) + return; + } + } + + private Task Resume() + { + TaskCompletionSource? newSignal = null; + + while (true) + { + var signal = Volatile.Read(ref _signal); + + if (signal != null) + { + return signal.Task; + } + + newSignal ??= new TaskCompletionSource(); + + if (Interlocked.CompareExchange(ref _signal, newSignal, null) == null) + { + return newSignal.Task; + } + } + } + } + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToAsyncEnumerable.Task.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToAsyncEnumerable.Task.cs new file mode 100644 index 000000000..af1914347 --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToAsyncEnumerable.Task.cs @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace System.Linq +{ + public static partial class AsyncEnumerableEx + { + /// + /// Converts a task to an async-enumerable sequence. + /// + /// The type of the elements in the source task. + /// Task to convert to an async-enumerable sequence. + /// The async-enumerable sequence whose element is pulled from the given task. + /// is null. + public static IAsyncEnumerable ToAsyncEnumerable(this Task task) + { + if (task == null) + throw Error.ArgumentNull(nameof(task)); + + return new TaskToAsyncEnumerable(task); + } + + private sealed class TaskToAsyncEnumerable : AsyncIterator + { + private readonly Task _task; + + public TaskToAsyncEnumerable(Task task) => _task = task; + + public override AsyncIteratorBase Clone() => new TaskToAsyncEnumerable(_task); + + protected override async ValueTask MoveNextCore() + { + if (_state == AsyncIteratorState.Allocated) + { + _state = AsyncIteratorState.Iterating; + _current = await _task.ConfigureAwait(false); + return true; + } + + return false; + } + } + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToObservable.cs b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToObservable.cs new file mode 100644 index 000000000..5be39166b --- /dev/null +++ b/Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/ToObservable.cs @@ -0,0 +1,83 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT License. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; + +namespace System.Linq +{ + public static partial class AsyncEnumerableEx + { + /// + /// Converts an async-enumerable sequence to an observable sequence. + /// + /// The type of the elements in the source sequence. + /// Enumerable sequence to convert to an observable sequence. + /// The observable sequence whose elements are pulled from the given enumerable sequence. + /// is null. + public static IObservable ToObservable(this IAsyncEnumerable source) + { + if (source == null) + throw Error.ArgumentNull(nameof(source)); + + return new ToObservableObservable(source); + } + + private sealed class ToObservableObservable : IObservable + { + private readonly IAsyncEnumerable _source; + + public ToObservableObservable(IAsyncEnumerable source) + { + _source = source; + } + + public IDisposable Subscribe(IObserver observer) + { + var ctd = new CancellationTokenDisposable(); + + async void Core() + { + await using var e = _source.GetAsyncEnumerator(ctd.Token); + do + { + bool hasNext; + var value = default(T)!; + + try + { + hasNext = await e.MoveNextAsync().ConfigureAwait(false); + if (hasNext) + { + value = e.Current; + } + } + catch (Exception ex) + { + if (!ctd.Token.IsCancellationRequested) + { + observer.OnError(ex); + } + + return; + } + + if (!hasNext) + { + observer.OnCompleted(); + return; + } + + observer.OnNext(value); + } + while (!ctd.Token.IsCancellationRequested); + } + + // Fire and forget + Core(); + + return ctd; + } + } + } +} diff --git a/Ix.NET/Source/System.Interactive.Async/TaskExt.cs b/Ix.NET/Source/System.Interactive.Async/TaskExt.cs index 18a0dee75..200cd6d9d 100644 --- a/Ix.NET/Source/System.Interactive.Async/TaskExt.cs +++ b/Ix.NET/Source/System.Interactive.Async/TaskExt.cs @@ -11,6 +11,13 @@ namespace System.Threading.Tasks internal static class TaskExt { public static readonly Task Never = new TaskCompletionSource().Task; + public static readonly TaskCompletionSource True; + + static TaskExt() + { + True = new TaskCompletionSource(); + True.SetResult(true); + } #if USE_FAIR_AND_CHEAPER_MERGE public static WhenAnyValueTask WhenAny(ValueTask[] tasks) diff --git a/Ix.NET/Source/System.Interactive.Providers/System.Interactive.Providers.csproj b/Ix.NET/Source/System.Interactive.Providers/System.Interactive.Providers.csproj index 09eba524d..6042eb1b5 100644 --- a/Ix.NET/Source/System.Interactive.Providers/System.Interactive.Providers.csproj +++ b/Ix.NET/Source/System.Interactive.Providers/System.Interactive.Providers.csproj @@ -3,7 +3,7 @@ Interactive Extensions Providers Library used to build query providers and express queries over enumerable sequences. Interactive Extensions - Providers Library - net48;netstandard2.0;net6.0 + net48;netstandard2.0;net8.0 Ix;Interactive;Extensions;Enumerable @@ -21,9 +21,7 @@ See ../../Documentation/adr/0001-Ix-Ref-Assembly-Mismatches.md --> - + - + + + + + + + + + + SystemLinqAsyncEnumerable + + + + diff --git a/Ix.NET/Source/System.Linq.Async.Queryable/System.Linq.Async.Queryable.csproj b/Ix.NET/Source/System.Linq.Async.Queryable/System.Linq.Async.Queryable.csproj index f653bc91a..20f3263f8 100644 --- a/Ix.NET/Source/System.Linq.Async.Queryable/System.Linq.Async.Queryable.csproj +++ b/Ix.NET/Source/System.Linq.Async.Queryable/System.Linq.Async.Queryable.csproj @@ -1,7 +1,7 @@  - net48;netstandard2.0;netstandard2.1;net6.0 + net48;netstandard2.0;netstandard2.1;net10.0 System.Linq.Async.Queryable LINQ;async;streams;query;provider Provides support for Language-Integrated Query (LINQ) over IAsyncQueryable<T> sequences with query providers. @@ -11,6 +11,20 @@ + + + + + + + + + SystemLinqAsyncEnumerable + + + + AsyncQueryable.Generated.tt diff --git a/Ix.NET/Source/System.Linq.Async.SourceGenerator/AsyncOverloadsGenerator.cs b/Ix.NET/Source/System.Linq.Async.SourceGenerator/AsyncOverloadsGenerator.cs index b0c27ecfe..656072265 100644 --- a/Ix.NET/Source/System.Linq.Async.SourceGenerator/AsyncOverloadsGenerator.cs +++ b/Ix.NET/Source/System.Linq.Async.SourceGenerator/AsyncOverloadsGenerator.cs @@ -33,12 +33,13 @@ public void Execute(GeneratorExecutionContext context) if (context.SyntaxReceiver is not SyntaxReceiver syntaxReceiver) return; var options = GetGenerationOptions(context); + var attributeSymbol = GetAsyncOverloadAttributeSymbol(context); var methodsBySyntaxTree = GetMethodsGroupedBySyntaxTree(context, syntaxReceiver); foreach (var grouping in methodsBySyntaxTree) context.AddSource( $"{Path.GetFileNameWithoutExtension(grouping.SyntaxTree.FilePath)}.AsyncOverloads", - GenerateOverloads(grouping, options)); + GenerateOverloads(grouping, options, context, attributeSymbol)); } private static GenerationOptions GetGenerationOptions(GeneratorExecutionContext context) @@ -50,22 +51,33 @@ private static IEnumerable GetMethodsGroupedBySyntaxTree(Ge syntaxReceiver, GetAsyncOverloadAttributeSymbol(context)); - private static string GenerateOverloads(AsyncMethodGrouping grouping, GenerationOptions options) + private static string GenerateOverloads(AsyncMethodGrouping grouping, GenerationOptions options, GeneratorExecutionContext context, INamedTypeSymbol attributeSymbol) { var usings = grouping.SyntaxTree.GetRoot() is CompilationUnitSyntax compilationUnit ? compilationUnit.Usings.ToString() : string.Empty; + // This source generator gets used not just in System.Linq.Async, but also for code that has migrated from + // System.Linq.Async to System.Interactive.Async. (E.g., we define overloads of AverageAsync that accept + // selector callbacks. The .NET runtime library implementation offers no equivalents. We want to continue + // to offer these even though we're decprecating System.Linq.Async, so they migrate into + // System.Interactive.Async.) In those cases, the containing type is typically AsyncEnumerableEx, + // but in System.Linq.Async it is AsyncEnumerable. So we need to discover the containing type name. + var containingTypeName = grouping.Methods.FirstOrDefault()?.Symbol.ContainingType.Name ?? "AsyncEnumerable"; + var overloads = new StringBuilder(); overloads.AppendLine("#nullable enable"); overloads.AppendLine(usings); overloads.AppendLine("namespace System.Linq"); overloads.AppendLine("{"); - overloads.AppendLine(" partial class AsyncEnumerable"); + overloads.AppendLine($" partial class {containingTypeName}"); overloads.AppendLine(" {"); foreach (var method in grouping.Methods) - overloads.AppendLine(GenerateOverload(method, options)); + { + var model = context.Compilation.GetSemanticModel(method.Syntax.SyntaxTree); + overloads.AppendLine(GenerateOverload(method, options, model, attributeSymbol)); + } overloads.AppendLine(" }"); overloads.AppendLine("}"); @@ -73,8 +85,22 @@ private static string GenerateOverloads(AsyncMethodGrouping grouping, Generation return overloads.ToString(); } - private static string GenerateOverload(AsyncMethod method, GenerationOptions options) - => MethodDeclaration(method.Syntax.ReturnType, GetMethodName(method.Symbol, options)) + //var allLeadingTrivia = method.Syntax.GetLeadingTrivia(); + //var allLeadingTriviaStructure = method.Syntax.GetLeadingTrivia().Select(t => t.GetStructure()); + //var leadingTrivia = method.Syntax.GetLeadingTrivia().Where(t => !t.IsKind(SyntaxKind.DisabledTextTrivia) && t.GetStructure() is not DirectiveTriviaSyntax); + + private static string GenerateOverload(AsyncMethod method, GenerationOptions options, SemanticModel model, INamedTypeSymbol attributeSymbol) + { + var attributeListsWithGenerateAsyncOverloadRemoved = SyntaxFactory.List(method.Syntax.AttributeLists + .Select(list => AttributeList(SeparatedList( + (from a in list.Attributes + let am = model.GetSymbolInfo(a.Name).Symbol?.ContainingType + where !SymbolEqualityComparer.Default.Equals(am, attributeSymbol) + select a)))) + .Where(list => list.Attributes.Count > 0)); + + return MethodDeclaration(method.Syntax.ReturnType, GetMethodName(method.Symbol, options)) + .WithAttributeLists(attributeListsWithGenerateAsyncOverloadRemoved) .WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.StaticKeyword))) .WithTypeParameterList(method.Syntax.TypeParameterList) .WithParameterList(method.Syntax.ParameterList) @@ -87,9 +113,10 @@ private static string GenerateOverload(AsyncMethod method, GenerationOptions opt method.Syntax.ParameterList.Parameters .Select(p => Argument(IdentifierName(p.Identifier)))))))) .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) - .WithLeadingTrivia(method.Syntax.GetLeadingTrivia().Where(t => t.GetStructure() is not DirectiveTriviaSyntax)) + .WithLeadingTrivia(method.Syntax.GetLeadingTrivia().Where(t => !t.IsKind(SyntaxKind.DisabledTextTrivia) && t.GetStructure() is not DirectiveTriviaSyntax)) .NormalizeWhitespace() .ToFullString(); + } private static INamedTypeSymbol GetAsyncOverloadAttributeSymbol(GeneratorExecutionContext context) => context.Compilation.GetTypeByMetadataName("System.Linq.GenerateAsyncOverloadAttribute") ?? throw new InvalidOperationException(); diff --git a/Ix.NET/Source/System.Linq.Async.SourceGenerator/Properties/launchSettings.json b/Ix.NET/Source/System.Linq.Async.SourceGenerator/Properties/launchSettings.json new file mode 100644 index 000000000..ecfa363e7 --- /dev/null +++ b/Ix.NET/Source/System.Linq.Async.SourceGenerator/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "System.Linq.Async": { + "commandName": "DebugRoslynComponent", + "targetProject": "..\\System.Linq.Async\\System.Linq.Async.csproj" + }, + "System.Interactive.Async": { + "commandName": "DebugRoslynComponent", + "targetProject": "..\\System.Interactive.Async\\System.Interactive.Async.csproj" + } + } +} \ No newline at end of file diff --git a/Ix.NET/Source/System.Linq.Async.SourceGenerator/System.Linq.Async.SourceGenerator.csproj b/Ix.NET/Source/System.Linq.Async.SourceGenerator/System.Linq.Async.SourceGenerator.csproj index 8604e8dc6..51925c090 100644 --- a/Ix.NET/Source/System.Linq.Async.SourceGenerator/System.Linq.Async.SourceGenerator.csproj +++ b/Ix.NET/Source/System.Linq.Async.SourceGenerator/System.Linq.Async.SourceGenerator.csproj @@ -1,6 +1,7 @@ netstandard2.0 + true 9.0 false diff --git a/Ix.NET/Source/System.Linq.Async.Tests/System.Linq.Async.Tests.csproj b/Ix.NET/Source/System.Linq.Async.Tests/System.Linq.Async.Tests.csproj index ed1c232ef..23e5b8294 100644 --- a/Ix.NET/Source/System.Linq.Async.Tests/System.Linq.Async.Tests.csproj +++ b/Ix.NET/Source/System.Linq.Async.Tests/System.Linq.Async.Tests.csproj @@ -1,7 +1,7 @@  - net48;net8.0;net6.0 + net48;net10.0;net8.0 + + SystemInteractiveAsync + + + + + + + + + + + SystemLinqAsyncEnumerable + + + + diff --git a/Ix.NET/Source/System.Linq.Async/System.Linq.Async.csproj b/Ix.NET/Source/System.Linq.Async/System.Linq.Async.csproj index 8c7df9bd2..37fe0f601 100644 --- a/Ix.NET/Source/System.Linq.Async/System.Linq.Async.csproj +++ b/Ix.NET/Source/System.Linq.Async/System.Linq.Async.csproj @@ -1,7 +1,7 @@  - net48;netstandard2.0;netstandard2.1;net6.0 + net48;netstandard2.0;netstandard2.1;net10.0 System.Linq.Async LINQ;async;streams;query Provides support for Language-Integrated Query (LINQ) over IAsyncEnumerable<T> sequences. @@ -16,6 +16,17 @@ Pack="true" /> + + + $(DefineConstants);INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + - $(NoWarn);NU5128;NU5131 + $(NoWarn);NU5128;NU5131;CS0618 @@ -57,10 +69,34 @@ - + + + + + + + + + + + + + + SystemLinqAsyncEnumerable + + + + True @@ -121,4 +157,8 @@ + + + + diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerablePartition.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerablePartition.cs index 9e84bd79a..71ea00c74 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerablePartition.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerablePartition.cs @@ -11,6 +11,7 @@ namespace System.Linq { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// An iterator that yields the items of part of an . /// @@ -379,4 +380,5 @@ private static async ValueTask SkipAndCountAsync(uint index, IAsyncEnumera return index; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncListPartition.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncListPartition.cs index 0ab5e9149..b58183572 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncListPartition.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncListPartition.cs @@ -11,6 +11,7 @@ namespace System.Linq { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// An iterator that yields the items of part of an . /// @@ -182,4 +183,5 @@ public ValueTask GetCountAsync(bool onlyIfCheap, CancellationToken cancella return new ValueTask(Count); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncGrouping.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncGrouping.cs index f89e9077b..e746d3413 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncGrouping.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncGrouping.cs @@ -6,6 +6,7 @@ namespace System.Linq { + // TODO: System.Linq does this as an IAsyncEnumerable> public interface IAsyncGrouping : IAsyncEnumerable { TKey Key { get; } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncIListProvider.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncIListProvider.cs index 133742620..f303daad8 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncIListProvider.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/IAsyncIListProvider.cs @@ -11,6 +11,15 @@ namespace System.Linq /// /// An iterator that can produce an array or through an optimized path. /// + /// + /// This interface is primarily used for internal purposes as an optimization for LINQ operators. It was made public because + /// it was defined in the System.Linq.Async package but also used in System.Interactive.Async. Now that + /// System.Linq.Async is being retired in favor of .NET 10.0's System.Linq.AsyncEnumerable, the + /// System.Interactive.Async package no longer takes a dependency on System.Linq.Async, and therefore defines + /// its own version of this interface. We can't replace this with a type forwarder here because that would risk creating a + /// circular dependency in cases where an application managed to get out-of-sync versions of the two packages. + /// + [Obsolete("This interface was always unsupported, and the IAsyncEnumerable LINQ implementation in System.Linq.AsyncEnumerable does not recognize it, so this no longer serves a purpose")] public interface IAsyncIListProvider : IAsyncEnumerable { /// diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/IOrderedAsyncEnumerable.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/IOrderedAsyncEnumerable.cs index d7093b314..14e6751ca 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/IOrderedAsyncEnumerable.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/IOrderedAsyncEnumerable.cs @@ -8,6 +8,7 @@ namespace System.Linq { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Represents a sorted async-enumerable sequence. /// @@ -46,4 +47,5 @@ public interface IOrderedAsyncEnumerable : IAsyncEnumerable CreateOrderedEnumerable(Func> keySelector, IComparer? comparer, bool descending); #endif } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs index 255921225..a6c3c11f8 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Aggregate.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.aggregateasync?view=net-9.0-pp#system-linq-asyncenumerable-aggregateasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-0-0))-system-threading-cancellationtoken) + + /// /// Applies an accumulator function over an async-enumerable sequence, returning the result of the aggregation as a single element in the result sequence. /// For aggregation behavior with incremental intermediate results, see System.Interactive.Async.AsyncEnumerableEx.Scan{TSource}. @@ -50,6 +54,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Applies an accumulator function over an async-enumerable sequence, returning the result of the aggregation as a single element in the result sequence. @@ -63,6 +68,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncThe source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AggregateAwaitAsync now exists as overloads of AggregateAsync.")] private static ValueTask AggregateAwaitAsyncCore(this IAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken = default) { if (source == null) @@ -93,7 +99,16 @@ static async ValueTask Core(IAsyncEnumerable source, Func AggregateAsync( + // this IAsyncEnumerable source, TAccumulate seed, Func> func, Func> resultSelector, CancellationToken cancellationToken = default); + // Corresponds to: + // public static ValueTask AggregateAwaitWithCancellationAsync( + // this IAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken = default) { } + [GenerateAsyncOverload] + [Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AggregateAwaitWithCancellationAsync functionality now exists as overloads of AggregateAsync.")] private static ValueTask AggregateAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken = default) { if (source == null) @@ -124,6 +139,11 @@ static async ValueTask Core(IAsyncEnumerable source, Func AggregateAsync(this IAsyncEnumerable source, TAccumulate seed, Func func, CancellationToken cancellationToken = default); + /// /// Applies an accumulator function over an async-enumerable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. /// For aggregation behavior with incremental intermediate results, see System.Interactive.Async.AsyncEnumerableEx.Scan{TSource, Accumulate}". @@ -158,6 +178,7 @@ static async ValueTask Core(IAsyncEnumerable source, TAccu return acc; } } +#endif /// /// Applies an accumulator function over an async-enumerable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. @@ -172,6 +193,7 @@ static async ValueTask Core(IAsyncEnumerable source, TAccu /// or is . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AggregateAwaitAsync functionality now exists as overloads of AggregateAsync.")] private static ValueTask AggregateAwaitAsyncCore(this IAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken = default) { if (source == null) @@ -196,6 +218,7 @@ static async ValueTask Core(IAsyncEnumerable source, TAccu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AggregateAwaitWithCancellationAsync functionality now exists as overloads of AggregateAsync.")] private static ValueTask AggregateAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken = default) { if (source == null) @@ -219,6 +242,10 @@ static async ValueTask Core(IAsyncEnumerable source, TAccu } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.aggregateasync?view=net-9.0-pp#system-linq-asyncenumerable-aggregateasync-3(system-collections-generic-iasyncenumerable((-0))-1-system-func((-1-0-1))-system-func((-1-2))-system-threading-cancellationtoken) + // public static ValueTask AggregateAsync(this IAsyncEnumerable source, TAccumulate seed, Func func, Func resultSelector, CancellationToken cancellationToken = default); + /// /// Applies an accumulator function over an async-enumerable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value, /// and the specified result selector function is used to select the result value. @@ -257,6 +284,7 @@ static async ValueTask Core(IAsyncEnumerable source, TAccumula return resultSelector(acc); } } +#endif /// /// Applies an accumulator function over an async-enumerable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value, @@ -273,6 +301,7 @@ static async ValueTask Core(IAsyncEnumerable source, TAccumula /// A ValueTask containing the value obtained by applying the result selector to the final accumulator value. /// or or is . [GenerateAsyncOverload] + [Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AggregateAwaitAsync functionality now exists as overloads of AggregateAsync.")] private static ValueTask AggregateAwaitAsyncCore(this IAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken = default) { if (source == null) @@ -299,6 +328,7 @@ static async ValueTask Core(IAsyncEnumerable source, TAccumula #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AggregateAwaitWithCancellationAsync functionality now exists as overloads of AggregateAsync.")] private static ValueTask AggregateAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs index f1b40e7b7..0ca91882a 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/All.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.allasync?view=net-9.0-pp#system-linq-asyncenumerable-allasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Determines whether all elements of an async-enumerable sequence satisfy a condition. /// @@ -42,6 +45,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Determines whether all elements in an async-enumerable sequence satisfy a condition. @@ -54,6 +58,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use AllAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AllAwaitAsync functionality now exists as overloads of All.")] private static ValueTask AllAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -79,6 +84,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AllAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs index 68138f4ca..14925d51b 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Any.cs @@ -10,6 +10,8 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.anyasync?view=net-9.0-pp#system-linq-asyncenumerable-anyasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) /// /// Determines whether an async-enumerable sequence contains any elements. /// @@ -34,6 +36,8 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellation } } + //https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.anyasync?view=net-9.0-pp#system-linq-asyncenumerable-anyasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Determines whether any element of an async-enumerable sequence satisfies a condition. /// @@ -66,6 +70,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Determines whether any element in an async-enumerable sequence satisfies a condition. @@ -78,6 +83,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use AnyAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the AnyAwaitAsync functionality now exists as overloads of AnyAsync.")] private static ValueTask AnyAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -103,6 +109,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AnyAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs index 8b146d68c..d533b595d 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AppendPrepend.cs @@ -12,6 +12,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.append?view=net-9.0-pp + /// /// Append a value to an async-enumerable sequence. /// @@ -33,6 +36,8 @@ public static IAsyncEnumerable Append(this IAsyncEnumerable(source, element, appending: true); } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.prepend?view=net-9.0-pp + /// /// Prepend a value to an async-enumerable sequence. /// @@ -53,6 +58,7 @@ public static IAsyncEnumerable Prepend(this IAsyncEnumerable(source, element, appending: false); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES private abstract class AppendPrependAsyncIterator : AsyncIterator, IAsyncIListProvider { diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AsAsyncEnumerable.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AsAsyncEnumerable.cs index ed1bc26d7..141663037 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AsAsyncEnumerable.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/AsAsyncEnumerable.cs @@ -7,8 +7,14 @@ namespace System.Linq { public static partial class AsyncEnumerable - { // NB: Synchronous LINQ to Objects doesn't hide the implementation of the source either. + { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // Note: this one isn't actually in the System.Linq.AsyncEnumerable package, so we've moved it + // to System.Interactive.Async because that's the home for LINQ-like implementations for + // IAsyncEnumerable that aren't in the runtime libraries. + // It therefore remains available only for runtime binary compatibility, and is no longer + // visible in System.Linq.Async at compile time. /// /// Hides the identity of an async-enumerable sequence. @@ -18,5 +24,6 @@ public static partial class AsyncEnumerable /// An async-enumerable sequence that hides the identity of the source sequence. /// is null. public static IAsyncEnumerable AsAsyncEnumerable(this IAsyncEnumerable source) => source; +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs index abc41a542..7c2581710 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.cs @@ -10,6 +10,7 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the average of an async-enumerable sequence of values. /// @@ -94,6 +95,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. @@ -107,6 +109,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncThe source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -143,6 +146,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -178,6 +182,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -262,9 +267,10 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. @@ -275,6 +281,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncThe source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -311,6 +318,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -346,6 +354,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -430,9 +439,10 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. @@ -443,6 +453,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncThe source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -479,6 +490,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -514,6 +526,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -598,9 +611,10 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. @@ -611,6 +625,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncThe source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -647,6 +662,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -682,6 +698,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -766,9 +783,10 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. @@ -779,6 +797,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncThe source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -815,6 +834,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -850,6 +870,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -950,18 +971,21 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. /// A transform function to invoke and await on each element of the source sequence. /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// A ValueTask containing the average of the sequence of values. /// or is . + /// The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1006,6 +1030,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1049,6 +1074,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -1149,18 +1175,21 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. /// A transform function to invoke and await on each element of the source sequence. /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// A ValueTask containing the average of the sequence of values. /// or is . + /// The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1205,6 +1234,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1248,6 +1278,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -1348,18 +1379,21 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. /// A transform function to invoke and await on each element of the source sequence. /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// A ValueTask containing the average of the sequence of values. /// or is . + /// The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1404,6 +1438,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1447,6 +1482,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -1547,18 +1583,21 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. /// A transform function to invoke and await on each element of the source sequence. /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// A ValueTask containing the average of the sequence of values. /// or is . + /// The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1603,6 +1642,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1646,6 +1686,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the average of an async-enumerable sequence of values. /// @@ -1746,18 +1787,21 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. /// /// The type of elements in the source sequence. /// An async-enumerable sequence of values to compute the average of. /// A transform function to invoke and await on each element of the source sequence. /// An optional cancellation token for cancelling the sequence at any time. - /// A ValueTask containing the average of the sequence of values, or if the source sequence is empty. + /// A ValueTask containing the average of the sequence of values. /// or is . + /// The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] private static ValueTask AverageAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1802,6 +1846,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.tt b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.tt index 9b53947e0..a7e193174 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.tt +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Average.Generated.tt @@ -50,6 +50,7 @@ foreach (var o in os) typeStr = "Nullable{" + o.type.Substring(0, 1).ToUpper() + o.type.Substring(1, o.type.Length - 2) + "}"; } #> +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the average of an async-enumerable sequence of values. /// @@ -214,8 +215,22 @@ else #> } } +#endif - internal static ValueTask<<#=o.res#>> AverageAwaitAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) + /// + /// Computes the average of an async-enumerable sequence of values that are obtained by invoking an asynchronous transform function on each element of the source sequence and awaiting the result. + /// + /// The type of elements in the source sequence. + /// An async-enumerable sequence of values to compute the average of. + /// A transform function to invoke and await on each element of the source sequence. + /// An optional cancellation token for cancelling the sequence at any time. + /// A ValueTask containing the average of the sequence of values. + /// or is . + /// The source sequence is empty. + /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] + private static ValueTask<<#=o.res#>> AverageAwaitAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -290,7 +305,9 @@ else } #if !NO_DEEP_CANCELLATION - internal static ValueTask<<#=o.res#>> AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) + [GenerateAsyncOverload] + [Obsolete("Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] + private static ValueTask<<#=o.res#>> AverageAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Cast.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Cast.cs index c52be4f98..3d54b9543 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Cast.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Cast.cs @@ -13,6 +13,9 @@ public static partial class AsyncEnumerable // NB: This is a non-standard LINQ operator, because we don't have a non-generic IAsyncEnumerable. // We're keeping it to enable `from T x in xs` binding in C#. +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.cast?view=net-9.0-pp + /// /// Converts the elements of an async-enumerable sequence to the specified type. /// @@ -40,5 +43,6 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, [Sy } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs index aabfcd187..3733b3248 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Concat.cs @@ -11,6 +11,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.concat?view=net-9.0-pp + /// /// Concatenates the second async-enumerable sequence to the first async-enumerable sequence upon successful termination of the first. /// @@ -253,5 +256,6 @@ internal override ConcatAsyncIterator Concat(IAsyncEnumerable } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Contains.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Contains.cs index 79779f120..1efc87304 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Contains.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Contains.cs @@ -10,6 +10,12 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.containsasync?view=net-9.0-pp + // + // These two overloads are replaced by the single method above, which takes a comparer, but supplies a default + // value of null. + /// /// Determines whether an async-enumerable sequence contains a specified element by using the default equality comparer. /// @@ -78,5 +84,6 @@ static async ValueTask Core(IAsyncEnumerable source, TSource valu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs index ba839a4a4..43b43e913 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs @@ -11,6 +11,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.countasync?view=net-9.0-pp#system-linq-asyncenumerable-countasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns an async-enumerable sequence containing an that represents the total number of elements in an async-enumerable sequence. /// @@ -50,6 +53,8 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationT } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.countasync?view=net-9.0-pp#system-linq-asyncenumerable-countasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns an async-enumerable sequence containing an that represents how many elements in the specified async-enumerable sequence satisfy a condition. /// @@ -87,6 +92,14 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Counts the elements in an async-enumerable sequence that satisfy a condition. @@ -98,6 +111,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the number of elements in the sequence that satisfy the predicate. /// or is . [GenerateAsyncOverload] + [Obsolete("Use CountAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the CountAwaitAsync functionality now exists as overloads of CountAsync.")] private static ValueTask CountAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -127,6 +141,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func CountAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/DefaultIfEmpty.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/DefaultIfEmpty.cs index 8fe637ffa..a3aabbd51 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/DefaultIfEmpty.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/DefaultIfEmpty.cs @@ -11,6 +11,7 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Returns the elements of the specified sequence or the type parameter's default value in a singleton sequence if the sequence is empty. /// @@ -136,5 +137,6 @@ public async ValueTask GetCountAsync(bool onlyIfCheap, CancellationToken ca return count == 0 ? 1 : count; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Distinct.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Distinct.cs index ba7618c43..fda821da3 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Distinct.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Distinct.cs @@ -10,6 +10,11 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.distinct?view=net-9.0-pp + // These two overloads are covered by a single method in System.Linq.AsyncEnumerable. Its only method + // takes a comparer, but specifies a default value of null. + /// /// Returns an async-enumerable sequence that contains only distinct elements. /// @@ -139,5 +144,6 @@ private Task> FillSetAsync(CancellationToken cancellationToken) return AsyncEnumerableHelpers.ToSet(_source, _comparer, cancellationToken); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs index 97d4a2bca..9ccf32866 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAt.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.elementatasync?view=net-9.0-pp#system-linq-asyncenumerable-elementatasync-1(system-collections-generic-iasyncenumerable((-0))-system-int32-system-threading-cancellationtoken) + /// /// Returns the element at a specified index in a sequence. /// @@ -66,5 +69,6 @@ static async ValueTask Core(IAsyncEnumerable source, int index throw Error.ArgumentOutOfRange(nameof(index)); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs index c06a09af3..a22dd503f 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ElementAtOrDefault.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.elementatordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-elementatordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-int32-system-threading-cancellationtoken) + /// /// Returns the element at a specified index in a sequence or a default value if the index is out of range. /// @@ -65,5 +68,6 @@ public static partial class AsyncEnumerable return default; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Empty.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Empty.cs index 7509ef4dc..a6d975a4d 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Empty.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Empty.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.empty?view=net-9.0-pp + /// /// Returns an empty async-enumerable sequence. /// @@ -50,5 +53,6 @@ public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellatio public ValueTask DisposeAsync() => default; } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Except.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Except.cs index 56c51c2f9..1bdfa7297 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Except.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Except.cs @@ -10,6 +10,11 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.except?view=net-9.0-pp + // + // These two overloads are replaced by the single method above, which takes a comparer, but supplies a default + // value of null. /// /// Produces the set difference of two async-enumerable sequences by using the default equality comparer to compare values. /// @@ -57,5 +62,6 @@ static async IAsyncEnumerable Core(IAsyncEnumerable first, IAs } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/First.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/First.cs index 2bcfbb862..55df31271 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/First.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/First.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.firstasync?view=net-9.0-pp#system-linq-asyncenumerable-firstasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns the first element of an async-enumerable sequence. /// @@ -34,6 +37,8 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.firstasync?view=net-9.0-pp#system-linq-asyncenumerable-firstasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns the first element of an async-enumerable sequence that satisfies the condition in the predicate. /// @@ -60,6 +65,10 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the first element of an async-enumerable sequence that satisfies the condition in the predicate. @@ -72,6 +81,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is . /// No element satisfies the condition in the predicate. -or- The source sequence is empty. [GenerateAsyncOverload] + [Obsolete("Use FirstAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the FirstAwaitAsync functionality now exists as overloads of FirstAsync.")] private static ValueTask FirstAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -91,6 +101,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func FirstAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs index d67b50ada..ea1a5345b 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.firstordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-firstordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns the first element of an async-enumerable sequence, or a default value if no such element exists. /// @@ -33,6 +36,8 @@ public static partial class AsyncEnumerable } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.firstordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-firstordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns the first element of an async-enumerable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// @@ -58,6 +63,9 @@ public static partial class AsyncEnumerable return first.HasValue ? first.Value : default; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.firstordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-firstordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-threading-cancellationtoken-system-threading-tasks-valuetask((system-boolean))))-system-threading-cancellationtoken) /// /// Returns the first element of an async-enumerable sequence that satisfies the condition in the predicate, or a default value if no element satisfies the condition in the predicate. @@ -69,6 +77,7 @@ public static partial class AsyncEnumerable /// A ValueTask containing the first element in the sequence that satisfies the predicate, or a default value if no element satisfies the predicate. /// or is . [GenerateAsyncOverload] + [Obsolete("Use FirstOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the FirstOrDefaultAwaitAsync functionality now exists as overloads of FirstOrDefaultAsync.")] private static ValueTask FirstOrDefaultAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -88,6 +97,7 @@ public static partial class AsyncEnumerable #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use FirstOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the FirstOrDefaultAwaitWithCancellationAsync functionality now exists as overloads of FirstOrDefaultAsync.")] private static ValueTask FirstOrDefaultAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs index 6e0302feb..6648c0f11 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs @@ -27,6 +27,7 @@ public static partial class AsyncEnumerable /// Task that signals the termination of the sequence. /// or is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. + [Obsolete("Use the language support for async foreach instead.")] public static Task ForEachAsync(this IAsyncEnumerable source, Action action, CancellationToken cancellationToken = default) { if (source == null) @@ -55,6 +56,7 @@ static async Task Core(IAsyncEnumerable source, Action action, /// Task that signals the termination of the sequence. /// or is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. + [Obsolete("Use the language support for async foreach instead.")] public static Task ForEachAsync(this IAsyncEnumerable source, Action action, CancellationToken cancellationToken = default) { if (source == null) @@ -85,6 +87,7 @@ static async Task Core(IAsyncEnumerable source, Action ac /// Task that signals the termination of the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use the language support for async foreach instead.")] private static Task ForEachAwaitAsyncCore(this IAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) { if (source == null) @@ -105,6 +108,7 @@ static async Task Core(IAsyncEnumerable source, Func act #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use the language support for async foreach instead.")] internal static Task ForEachAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func action, CancellationToken cancellationToken) { if (source == null) @@ -134,6 +138,7 @@ static async Task Core(IAsyncEnumerable source, FuncTask that signals the termination of the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use the language support for async foreach instead.")] private static Task ForEachAwaitAsyncCore(this IAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) { if (source == null) @@ -156,6 +161,7 @@ static async Task Core(IAsyncEnumerable source, Func(this IAsyncEnumerable source, Func action, CancellationToken cancellationToken) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupBy.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupBy.cs index 75f9459cc..cd684e72a 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupBy.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupBy.cs @@ -10,6 +10,17 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // The next two methods are replaced by a single method in System.Linq.AsyncEnumerable: + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.groupby?view=net-9.0-pp#system-linq-asyncenumerable-groupby-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-iequalitycomparer((-1))) + // It has a different signature from both: + // Returns an IAsyncEnumerable>, which is not the same as IAsyncGrouping + // Supplies a default value of null for the comparer + // That second difference is why there's only the one overload. + // The first difference seems large: IAsyncGrouping returns each group as an IAsyncEnumerable. In practice, + // the grouping operators enumerate the source to completion before returning anything so in practice this + // async capability is not used, and just complicates things for the consumer. + /// /// Groups the elements of an async-enumerable sequence according to a specified key selector function. /// @@ -34,6 +45,7 @@ public static IAsyncEnumerable> GroupBy or or is null. public static IAsyncEnumerable> GroupBy(this IAsyncEnumerable source, Func keySelector, IEqualityComparer? comparer) => new GroupedAsyncEnumerable(source, keySelector, comparer); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Groups the elements of an async-enumerable sequence according to a specified key selector function. @@ -45,6 +57,7 @@ public static IAsyncEnumerable> GroupByA sequence of async-enumerable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector) => new GroupedAsyncEnumerableWithTask(source, keySelector, comparer: null); @@ -59,18 +72,31 @@ private static IAsyncEnumerable> GroupByAwaitCore< /// A sequence of async-enumerable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// or or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector, IEqualityComparer? comparer) => new GroupedAsyncEnumerableWithTask(source, keySelector, comparer); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector) => new GroupedAsyncEnumerableWithTaskAndCancellation(source, keySelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, IEqualityComparer? comparer) => new GroupedAsyncEnumerableWithTaskAndCancellation(source, keySelector, comparer); #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // The next two methods are replaced by a single method in System.Linq.AsyncEnumerable: + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.groupby?view=net-9.0-pp#system-linq-asyncenumerable-groupby-3(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-func((-0-2))-system-collections-generic-iequalitycomparer((-1))) + // It has a different signature from both: + // Returns an IAsyncEnumerable>, which is not the same as IAsyncGrouping + // Supplies a default value of null for the comparer + // That second difference is why there's only the one overload. + // The first difference seems large: IAsyncGrouping returns each group as an IAsyncEnumerable. In practice, + // the grouping operators enumerate the source to completion before returning anything so in practice this + // async capability is not used, and just complicates things for the consumer. /// /// Groups the elements of an async-enumerable sequence and selects the resulting elements by using a specified function. @@ -100,6 +126,7 @@ public static IAsyncEnumerable> GroupBy or or or is null. public static IAsyncEnumerable> GroupBy(this IAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer? comparer) => new GroupedAsyncEnumerable(source, keySelector, elementSelector, comparer); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Groups the elements of an async-enumerable sequence and selects the resulting elements by using a specified function. @@ -113,6 +140,7 @@ public static IAsyncEnumerable> GroupByA sequence of async-enumerable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// or or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector) => new GroupedAsyncEnumerableWithTask(source, keySelector, elementSelector, comparer: null); @@ -129,24 +157,30 @@ private static IAsyncEnumerable> GroupByAwaitCore /// A sequence of async-enumerable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// or or or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer? comparer) => new GroupedAsyncEnumerableWithTask(source, keySelector, elementSelector, comparer); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector) => new GroupedAsyncEnumerableWithTaskAndCancellation(source, keySelector, elementSelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable> GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer? comparer) => new GroupedAsyncEnumerableWithTaskAndCancellation(source, keySelector, elementSelector, comparer); #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.groupby?view=net-9.0-pp#system-linq-asyncenumerable-groupby-3(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-func((-1-system-collections-generic-ienumerable((-0))-2))-system-collections-generic-iequalitycomparer((-1))) public static IAsyncEnumerable GroupBy(this IAsyncEnumerable source, Func keySelector, Func, TResult> resultSelector) => new GroupedResultAsyncEnumerable(source, keySelector, resultSelector, comparer: null); public static IAsyncEnumerable GroupBy(this IAsyncEnumerable source, Func keySelector, Func, TResult> resultSelector, IEqualityComparer? comparer) => new GroupedResultAsyncEnumerable(source, keySelector, resultSelector, comparer); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Groups the elements of an async-enumerable sequence according to a specified key selector function, and then applies a result selector function to each group. @@ -160,6 +194,7 @@ public static IAsyncEnumerable GroupBy(this IAs /// An async-enumerable sequence of results obtained by invoking and awaiting the result-selector function on each group. /// or or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector, Func, ValueTask> resultSelector) => new GroupedResultAsyncEnumerableWithTask(source, keySelector, resultSelector, comparer: null); @@ -176,24 +211,32 @@ private static IAsyncEnumerable GroupByAwaitCoreAn async-enumerable sequence of results obtained by invoking and awaiting the result-selector function on each group. /// or or or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector, Func, ValueTask> resultSelector, IEqualityComparer? comparer) => new GroupedResultAsyncEnumerableWithTask(source, keySelector, resultSelector, comparer); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, Func, CancellationToken, ValueTask> resultSelector) => new GroupedResultAsyncEnumerableWithTaskAndCancellation(source, keySelector, resultSelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, Func, CancellationToken, ValueTask> resultSelector, IEqualityComparer? comparer) => new GroupedResultAsyncEnumerableWithTaskAndCancellation(source, keySelector, resultSelector, comparer); #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // This covers the next two + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.groupby?view=net-9.0-pp#system-linq-asyncenumerable-groupby-4(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-threading-cancellationtoken-system-threading-tasks-valuetask((-1))))-system-func((-0-system-threading-cancellationtoken-system-threading-tasks-valuetask((-2))))-system-func((-1-system-collections-generic-ienumerable((-2))-system-threading-cancellationtoken-system-threading-tasks-valuetask((-3))))-system-collections-generic-iequalitycomparer((-1))) + public static IAsyncEnumerable GroupBy(this IAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector) => new GroupedResultAsyncEnumerable(source, keySelector, elementSelector, resultSelector, comparer: null); public static IAsyncEnumerable GroupBy(this IAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer? comparer) => new GroupedResultAsyncEnumerable(source, keySelector, elementSelector, resultSelector, comparer); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Groups the elements of an async-enumerable sequence according to a specified key-selector function, applies an element selector to each element of each group, then applies a result selector to each transformed group. @@ -209,6 +252,7 @@ public static IAsyncEnumerable GroupByAn async-enumerable sequence of results obtained by invoking the result selector function on each group and awaiting the result. /// or or or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, ValueTask> resultSelector) => new GroupedResultAsyncEnumerableWithTask(source, keySelector, elementSelector, resultSelector, comparer: null); @@ -227,15 +271,18 @@ private static IAsyncEnumerable GroupByAwaitCoreAn async-enumerable sequence of results obtained by invoking the result selector function on each group and awaiting the result. /// or or or or is . [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwait functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, ValueTask> resultSelector, IEqualityComparer? comparer) => new GroupedResultAsyncEnumerableWithTask(source, keySelector, elementSelector, resultSelector, comparer); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, ValueTask> resultSelector) => new GroupedResultAsyncEnumerableWithTaskAndCancellation(source, keySelector, elementSelector, resultSelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupByAwaitWithCancellationAsync functionality now exists as overloads of GroupBy.")] private static IAsyncEnumerable GroupByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, ValueTask> resultSelector, IEqualityComparer? comparer) => new GroupedResultAsyncEnumerableWithTaskAndCancellation(source, keySelector, elementSelector, resultSelector, comparer); #endif diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupJoin.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupJoin.cs index e1182bc95..59af1f8e5 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupJoin.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/GroupJoin.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.groupjoin?view=net-9.0-pp#system-linq-asyncenumerable-groupjoin-4(system-collections-generic-iasyncenumerable((-0))-system-collections-generic-iasyncenumerable((-1))-system-func((-0-2))-system-func((-1-2))-system-func((-0-system-collections-generic-ienumerable((-1))-3))-system-collections-generic-iequalitycomparer((-2))) + // The method above covers the next two overloads because it supplies a default null value for comparer. + /// /// Correlates the elements of two async-enumerable sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. /// @@ -75,12 +79,15 @@ static async IAsyncEnumerable Core(IAsyncEnumerable outer, IAsy } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES [GenerateAsyncOverload] + [Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupJoinAwait functionality now exists as overloads of GroupJoin.")] private static IAsyncEnumerable GroupJoinAwaitCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, ValueTask> resultSelector) => GroupJoinAwaitCore(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupJoinAwait functionality now exists as overloads of GroupJoin.")] private static IAsyncEnumerable GroupJoinAwaitCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, ValueTask> resultSelector, IEqualityComparer? comparer) { if (outer == null) @@ -117,10 +124,12 @@ static async IAsyncEnumerable Core(IAsyncEnumerable outer, IAsy #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupJoinAwaitWithCancellation functionality now exists as overloads of GroupJoin.")] private static IAsyncEnumerable GroupJoinAwaitWithCancellationCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, ValueTask> resultSelector) => GroupJoinAwaitWithCancellationCore(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the GroupJoinAwaitWithCancellation functionality now exists as overloads of GroupJoin.")] private static IAsyncEnumerable GroupJoinAwaitWithCancellationCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, ValueTask> resultSelector, IEqualityComparer? comparer) { if (outer == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Intersect.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Intersect.cs index 00c76f0bb..1e5639e6c 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Intersect.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Intersect.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.intersect?view=net-9.0-pp + // The method above covers the next two overloads because it supplies a default null value for comparer. + /// /// Produces the set intersection of two async-enumerable sequences by using the default equality comparer to compare values. /// @@ -57,5 +61,6 @@ static async IAsyncEnumerable Core(IAsyncEnumerable first, IAs } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Join.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Join.cs index e27723c9f..cb80f6cb0 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Join.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Join.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.join?view=net-9.0-pp#system-linq-asyncenumerable-join-4(system-collections-generic-iasyncenumerable((-0))-system-collections-generic-iasyncenumerable((-1))-system-func((-0-2))-system-func((-1-2))-system-func((-0-1-3))-system-collections-generic-iequalitycomparer((-2))) + // The method above covers the next two overloads because it supplies a default null value for comparer. + /// /// Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. /// @@ -91,12 +95,17 @@ static async IAsyncEnumerable Core(IAsyncEnumerable outer, IAsy } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.join?view=net-9.0-pp#system-linq-asyncenumerable-join-4(system-collections-generic-iasyncenumerable((-0))-system-collections-generic-iasyncenumerable((-1))-system-func((-0-system-threading-cancellationtoken-system-threading-tasks-valuetask((-2))))-system-func((-1-system-threading-cancellationtoken-system-threading-tasks-valuetask((-2))))-system-func((-0-1-system-threading-cancellationtoken-system-threading-tasks-valuetask((-3))))-system-collections-generic-iequalitycomparer((-2))) [GenerateAsyncOverload] + [Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the JoinAwait functionality now exists as overloads of Join.")] private static IAsyncEnumerable JoinAwaitCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector) => JoinAwaitCore(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the JoinAwait functionality now exists as overloads of Join.")] private static IAsyncEnumerable JoinAwaitCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer? comparer) { if (outer == null) @@ -149,10 +158,12 @@ static async IAsyncEnumerable Core(IAsyncEnumerable outer, IAsy #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the JoinAwaitWithCancellation functionality now exists as overloads of Join.")] private static IAsyncEnumerable JoinAwaitWithCancellationCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector) => JoinAwaitWithCancellationCore(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer: null); [GenerateAsyncOverload] + [Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the JoinAwaitWithCancellation functionality now exists as overloads of Join.")] private static IAsyncEnumerable JoinAwaitWithCancellationCore(this IAsyncEnumerable outer, IAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer? comparer) { if (outer == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Last.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Last.cs index 0e77b193c..b4087d545 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Last.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Last.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.lastasync?view=net-9.0-pp#system-linq-asyncenumerable-lastasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns the last element of an async-enumerable sequence. /// @@ -34,6 +37,8 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.lastasync?view=net-9.0-pp#system-linq-asyncenumerable-lastasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns the last element of an async-enumerable sequence that satisfies the condition in the predicate. /// @@ -61,6 +66,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the last element of an async-enumerable sequence that satisfies the condition in the predicate. /// @@ -72,6 +79,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is null. /// (Asynchronous) No element satisfies the condition in the predicate. -or- The source sequence is empty. [GenerateAsyncOverload] + [Obsolete("Use LastAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the LastAwaitAsync functionality now exists as overloads of LastAsync.")] private static ValueTask LastAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -91,6 +99,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func LastAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs index 9dae828c1..1a1c2fe53 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LastOrDefault.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.lastordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-lastordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns the last element of an async-enumerable sequence, or a default value if no such element exists. /// @@ -33,6 +36,8 @@ public static partial class AsyncEnumerable } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.lastordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-lastordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns the last element of an async-enumerable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// @@ -58,6 +63,9 @@ public static partial class AsyncEnumerable return last.HasValue ? last.Value : default; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.lastordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-lastordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-threading-cancellationtoken-system-threading-tasks-valuetask((system-boolean))))-system-threading-cancellationtoken) /// /// Returns the last element of an async-enumerable sequence that satisfies the condition in the predicate, or a default value if no such element exists. @@ -69,6 +77,7 @@ public static partial class AsyncEnumerable /// ValueTask containing the last element in the async-enumerable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use LastOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the LastOrDefaultAwaitAsync functionality now exists as overloads of LastOrDefaultAsync.")] private static ValueTask LastOrDefaultAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -88,6 +97,7 @@ public static partial class AsyncEnumerable #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use LastOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the LastOrDefaultAwaitWithCancellationAsync functionality now exists as overloads of LastOrDefaultAsync.")] private static ValueTask LastOrDefaultAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs index 463ce0ec0..e62e94e7f 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/LongCount.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.longcountasync?view=net-9.0-pp#system-linq-asyncenumerable-longcountasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns an async-enumerable sequence containing an that represents the total number of elements in an async-enumerable sequence. /// @@ -43,6 +46,8 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellation } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.longcountasync?view=net-9.0-pp#system-linq-asyncenumerable-longcountasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns an async-enumerable sequence containing an that represents how many elements in the specified async-enumerable sequence satisfy a condition. /// @@ -80,6 +85,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns an async-enumerable sequence containing a that represents the number of elements in the specified async-enumerable sequence that satisfy a condition. @@ -92,6 +98,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use LongCountAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the LongCountAwaitAsync functionality now exists as overloads of LongCountAsync.")] private static ValueTask LongCountAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -122,6 +129,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func LongCountAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Max.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Max.cs index 6190d7043..a15dbd393 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Max.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Max.cs @@ -10,6 +10,16 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.maxasync?view=net-9.0-pp + // The method above has a slightly different signature: it takes a comparer. In cases where the cancellationToken + // has not been supplied, or has been passed by name, that method is source-compatible with this one. + // However, anyone calling this method with an unnamed cancellationToken argument will get an error because + // the comparer argument comes before the cancellationToken argument. There's not much we can do about + // this because if we continue to offer this method, it will result in ambiguous matches. The least bad + // option seems to be to hide this method, and anyone who was relying on it taking a positional + // cancellation token argument will need to deal with the compilation error. + /// /// Returns the maximum element in an async-enumerable sequence. /// @@ -95,6 +105,8 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat } } +#endif + /// /// Invokes a transform function on each element of a sequence and returns the maximum value. /// @@ -106,6 +118,7 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat /// A ValueTask containing a single element with the value that corresponds to the maximum element in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by the MaxAsync overload that took a selector callback now exists as an overload of MaxByAsync.")] public static ValueTask MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -196,6 +209,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -277,6 +291,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Min.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Min.cs index 5075c5e48..617d5070b 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Min.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Min.cs @@ -10,6 +10,16 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.minasync?view=net-9.0-pp + // The method above has a slightly different signature: it takes a comparer. In cases where the cancellationToken + // has not been supplied, or has been passed by name, that method is source-compatible with this one. + // However, anyone calling this method with an unnamed cancellationToken argument will get an error because + // the comparer argument comes before the cancellationToken argument. There's not much we can do about + // this because if we continue to offer this method, it will result in ambiguous matches. The least bad + // option seems to be to hide this method, and anyone who was relying on it taking a positional + // cancellation token argument will need to deal with the compilation error. + /// /// Returns the minimum element in an async-enumerable sequence. /// @@ -96,6 +106,8 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat } } +#endif + /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// @@ -107,6 +119,7 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by the MinAsync overload that took a selector callback now exists as an overload of MinByAsync.")] public static ValueTask MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -198,6 +211,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -279,6 +293,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.cs index 47d0052d7..1ddb0773a 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/MinMax.Generated.cs @@ -10,6 +10,7 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -50,7 +51,9 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationToken return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -87,8 +90,10 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Returns the maximum value in an async-enumerable sequence. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// /// Type of elements in the source sequence. /// The source sequence. @@ -97,6 +102,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -135,6 +141,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -172,6 +179,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -251,7 +260,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -327,8 +338,10 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Returns the maximum value in an async-enumerable sequence. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// /// Type of elements in the source sequence. /// The source sequence. @@ -337,6 +350,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -414,6 +428,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -490,6 +505,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -530,7 +547,9 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationTok return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -567,6 +586,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -577,6 +598,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -615,6 +637,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -652,6 +675,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -731,7 +756,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -807,6 +834,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -817,6 +846,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -894,6 +924,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -970,6 +1001,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -1025,7 +1058,9 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationT return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1077,6 +1112,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -1087,6 +1124,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1140,6 +1178,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1192,6 +1231,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -1267,7 +1308,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1339,6 +1382,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -1349,6 +1394,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1422,6 +1468,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1494,6 +1541,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -1549,7 +1598,9 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellatio return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1601,6 +1652,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -1611,6 +1664,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1664,6 +1718,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1716,6 +1771,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -1791,7 +1848,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1863,6 +1922,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -1873,6 +1934,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1946,6 +2008,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2018,6 +2081,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -2058,7 +2123,9 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2095,6 +2162,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -2105,6 +2174,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2143,6 +2213,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2180,6 +2251,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the maximum value in an async-enumerable sequence of values. /// @@ -2233,7 +2306,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2283,6 +2358,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// @@ -2293,6 +2370,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncA ValueTask containing the maximum value in the sequence. /// or is . [GenerateAsyncOverload] + [Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MaxAwaitAsync now exists as an overload of MaxByAsync.")] private static ValueTask MaxAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2344,6 +2422,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MaxAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2394,6 +2473,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -2434,7 +2515,9 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationToken return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2471,17 +2554,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2520,6 +2605,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2557,6 +2643,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -2612,7 +2700,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2664,17 +2754,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2728,6 +2820,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2780,6 +2873,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -2820,7 +2915,9 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationTok return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2857,17 +2954,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2906,6 +3005,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -2943,6 +3043,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -2998,7 +3100,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3050,17 +3154,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3114,6 +3220,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3166,6 +3273,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -3222,7 +3331,9 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationT return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3275,17 +3386,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3340,6 +3453,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3393,6 +3507,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -3464,7 +3580,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3532,17 +3650,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3612,6 +3732,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3680,6 +3801,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -3736,7 +3859,9 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellatio return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3789,17 +3914,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3854,6 +3981,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -3907,6 +4035,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -3978,7 +4108,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4046,17 +4178,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4126,6 +4260,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4194,6 +4329,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -4234,7 +4371,9 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat return value; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static ValueTask MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4271,17 +4410,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4319,7 +4460,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4357,6 +4499,8 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the minimum value in an async-enumerable sequence of values. /// @@ -4410,7 +4554,9 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4460,17 +4606,19 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Invokes and awaits a transform function on each element of a sequence and returns the minimum value. + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. /// - /// The type of the elements in the source sequence. - /// An async-enumerable sequence to determine the minimum element of. - /// An asynchronous transform function to invoke and await on each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask sequence containing a single element with the value that corresponds to the minimum element in the source sequence. - /// or is null. - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . [GenerateAsyncOverload] + [Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by MinAwaitAsync now exists as an overload of MinByAsync.")] private static ValueTask MinAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4522,6 +4670,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func MinAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -4572,5 +4721,6 @@ static async ValueTask Core(IAsyncEnumerable source, Func +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Returns the <#=extremum#> value in an async-enumerable sequence of values. /// @@ -288,6 +289,7 @@ foreach (var m in new[] { "Max", "Min" }) #> } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES <# foreach (var overload in new[] { @@ -299,7 +301,7 @@ foreach (var overload in new[] { var isAsync = overload.invoke.StartsWith("await"); var isDeepCancellation = overload.selector.Contains("CancellationToken"); var suffix = isAsync ? "Await" : ""; - var visibility = isAsync ? "internal" : "public"; + var visibility = isAsync ? "private" : "public"; var core = isAsync ? "Core" : ""; if (isDeepCancellation) @@ -307,8 +309,34 @@ foreach (var overload in new[] { suffix += "WithCancellation"; #> #if !NO_DEEP_CANCELLATION + [GenerateAsyncOverload] +<# + } else if (isAsync) + { +#> + /// + /// Invokes and awaits a transform function on each element of a sequence and returns the maximum value. + /// + /// Type of elements in the source sequence. + /// The source sequence. + /// An asynchronous transform function to invoke and await on each element of the source. + /// The optional cancellation token to be usef for cancelling the sequence at any time. + /// A ValueTask containing the maximum value in the sequence. + /// or is . + [GenerateAsyncOverload] +<# + } + if (isDeepCancellation || isAsync) + { +#> + [Obsolete("Use <#=m#>ByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the functionality previously provided by <#=m#><#=suffix#>Async now exists as an overload of <#=m#>ByAsync.")] +<# + } else { +#> +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES <# } + #> <#=visibility#> static ValueTask<<#=t#>> <#=m#><#=suffix#>Async<#=core#>(this IAsyncEnumerable source, <#=overload.selector#> selector, CancellationToken cancellationToken = default) { @@ -566,6 +594,15 @@ foreach (var overload in new[] { { #> #endif + +<# + } + + if (!(isDeepCancellation || isAsync)) + { +#> +#endif + <# } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OfType.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OfType.cs index b9e2bb476..bbd94d939 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OfType.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OfType.cs @@ -17,6 +17,11 @@ public static partial class AsyncEnumerable // the source is not an option, because it would require users to specify two type arguments, unlike // what's done in Enumerable.OfType. Should we move this method to Ix, thus doing away with OfType // in the API surface altogether? + // IDG 2025/09/30: System.Linq.AsyncEnumerable implemented this one despite the limitations (and despite + // not implementing AsAsyncEnumerable). + +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.oftype?view=net-9.0-pp /// /// Filters the elements of an async-enumerable sequence based on the specified type. @@ -43,5 +48,6 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, [S } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderBy.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderBy.cs index ecb1b1207..5d431b5a2 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderBy.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderBy.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT License. // See the LICENSE file in the project root for more information. @@ -8,8 +8,13 @@ namespace System.Linq { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.orderby?view=net-9.0-pp#system-linq-asyncenumerable-orderby-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + // The method linked to above includes a comparer parameter with a default value of null. + /// /// Sorts the elements of a sequence in ascending order according to a key. /// @@ -21,6 +26,7 @@ public static partial class AsyncEnumerable /// or is null. public static IOrderedAsyncEnumerable OrderBy(this IAsyncEnumerable source, Func keySelector) => new OrderedAsyncEnumerable(source, keySelector, comparer: null, descending: false, parent: null); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Sorts the elements of a sequence in ascending order according to a key obtained by invoking a transform function on each element and awaiting the result. @@ -32,15 +38,20 @@ public static IOrderedAsyncEnumerable OrderBy(this IAsyn /// An ordered async-enumerable sequence whose elements are sorted according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByAwait functionality now exists as overloads of OrderBy.")] private static IOrderedAsyncEnumerable OrderByAwaitCore(this IAsyncEnumerable source, Func> keySelector) => new OrderedAsyncEnumerableWithTask(source, keySelector, comparer: null, descending: false, parent: null); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByAwaitWithCancellation functionality now exists as overloads of OrderBy.")] private static IOrderedAsyncEnumerable OrderByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector) => new OrderedAsyncEnumerableWithTaskAndCancellation(source, keySelector, comparer: null, descending: false, parent: null); #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.orderby?view=net-9.0-pp#system-linq-asyncenumerable-orderby-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + /// /// Sorts the elements of a sequence in ascending order by using a specified comparer. /// @@ -53,6 +64,7 @@ private static IOrderedAsyncEnumerable OrderByAwaitWithCancellationCore /// or is null. public static IOrderedAsyncEnumerable OrderBy(this IAsyncEnumerable source, Func keySelector, IComparer comparer) => new OrderedAsyncEnumerable(source, keySelector, comparer, descending: false, parent: null); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Sorts the elements of a sequence in ascending order by using a specified comparer. The keys are obtained by invoking the transform function on each element and awaiting the result. @@ -65,15 +77,21 @@ public static IOrderedAsyncEnumerable OrderBy(this IAsyn /// An ordered async-enumerable sequence whose elements are sorted according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByAwait functionality now exists as overloads of OrderBy.")] private static IOrderedAsyncEnumerable OrderByAwaitCore(this IAsyncEnumerable source, Func> keySelector, IComparer comparer) => new OrderedAsyncEnumerableWithTask(source, keySelector, comparer, descending: false, parent: null); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByAwaitWithCancellation functionality now exists as overloads of OrderBy.")] private static IOrderedAsyncEnumerable OrderByAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, IComparer comparer) => new OrderedAsyncEnumerableWithTaskAndCancellation(source, keySelector, comparer, descending: false, parent: null); #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.orderbydescending?view=net-9.0-pp#system-linq-asyncenumerable-orderbydescending-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + // The method linked to above includes a comparer parameter with a default value of null. + /// /// Sorts the elements of a sequence in descending order according to a key. /// @@ -85,6 +103,7 @@ private static IOrderedAsyncEnumerable OrderByAwaitWithCancellationCore /// or is null. public static IOrderedAsyncEnumerable OrderByDescending(this IAsyncEnumerable source, Func keySelector) => new OrderedAsyncEnumerable(source, keySelector, comparer: null, descending: true, parent: null); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Sorts the elements of a sequence in descending order according to a key obtained by invoking a transform function on each element and awaiting the result. @@ -96,15 +115,20 @@ public static IOrderedAsyncEnumerable OrderByDescending( /// An ordered async-enumerable sequence whose elements are sorted in descending order according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByDescendingAwait functionality now exists as overloads of OrderByDescending.")] private static IOrderedAsyncEnumerable OrderByDescendingAwaitCore(this IAsyncEnumerable source, Func> keySelector) => new OrderedAsyncEnumerableWithTask(source, keySelector, comparer: null, descending: true, parent: null); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByDescendingAwaitWithCancellation functionality now exists as overloads of OrderByDescending.")] private static IOrderedAsyncEnumerable OrderByDescendingAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector) => new OrderedAsyncEnumerableWithTaskAndCancellation(source, keySelector, comparer: null, descending: true, parent: null); #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.orderbydescending?view=net-9.0-pp#system-linq-asyncenumerable-orderbydescending-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + /// /// Sorts the elements of a sequence in descending order by using a specified comparer. /// @@ -117,6 +141,7 @@ private static IOrderedAsyncEnumerable OrderByDescendingAwaitWithCancel /// or is null. public static IOrderedAsyncEnumerable OrderByDescending(this IAsyncEnumerable source, Func keySelector, IComparer comparer) => new OrderedAsyncEnumerable(source, keySelector, comparer, descending: true, parent: null); +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Sorts the elements of a sequence in descending order by using a specified comparer. The keys are obtained by invoking the transform function on each element and awaiting the result. @@ -129,15 +154,21 @@ public static IOrderedAsyncEnumerable OrderByDescending( /// An ordered async-enumerable sequence whose elements are sorted in descending order according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByDescendingAwait functionality now exists as overloads of OrderByDescending.")] private static IOrderedAsyncEnumerable OrderByDescendingAwaitCore(this IAsyncEnumerable source, Func> keySelector, IComparer comparer) => new OrderedAsyncEnumerableWithTask(source, keySelector, comparer, descending: true, parent: null); #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the OrderByDescendingAwaitWithCancellation functionality now exists as overloads of OrderByDescending.")] private static IOrderedAsyncEnumerable OrderByDescendingAwaitWithCancellationCore(this IAsyncEnumerable source, Func> keySelector, IComparer comparer) => new OrderedAsyncEnumerableWithTaskAndCancellation(source, keySelector, comparer, descending: true, parent: null); #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.thenby?view=net-9.0-pp#system-linq-asyncenumerable-thenby-2(system-linq-iorderedasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + // The method linked to above includes a comparer parameter with a default value of null. + /// /// Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. /// @@ -154,6 +185,7 @@ public static IOrderedAsyncEnumerable ThenBy(this IOrder return source.CreateOrderedEnumerable(keySelector, comparer: null, descending: false); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Performs a subsequent ordering of the elements in a sequence in ascending order according to a key obtained by invoking a transform function on each element and awaiting the result. @@ -165,6 +197,7 @@ public static IOrderedAsyncEnumerable ThenBy(this IOrder /// An ordered async-enumerable whose elements are sorted according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ThenByAwait functionality now exists as overloads of ThenBy.")] private static IOrderedAsyncEnumerable ThenByAwaitCore(this IOrderedAsyncEnumerable source, Func> keySelector) { if (source == null) @@ -175,6 +208,7 @@ private static IOrderedAsyncEnumerable ThenByAwaitCore(t #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ThenByAwaitWithCancellation functionality now exists as overloads of ThenBy.")] private static IOrderedAsyncEnumerable ThenByAwaitWithCancellationCore(this IOrderedAsyncEnumerable source, Func> keySelector) { if (source == null) @@ -184,6 +218,9 @@ private static IOrderedAsyncEnumerable ThenByAwaitWithCancellationCore< } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.thenby?view=net-9.0-pp#system-linq-asyncenumerable-thenby-2(system-linq-iorderedasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + /// /// Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. /// @@ -201,6 +238,7 @@ public static IOrderedAsyncEnumerable ThenBy(this IOrder return source.CreateOrderedEnumerable(keySelector, comparer, descending: false); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. The keys are obtained by invoking a transform function on each element and awaiting the result. @@ -213,6 +251,7 @@ public static IOrderedAsyncEnumerable ThenBy(this IOrder /// An ordered async-enumerable whose elements are sorted according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ThenByAwait functionality now exists as overloads of ThenBy.")] private static IOrderedAsyncEnumerable ThenByAwaitCore(this IOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) { if (source == null) @@ -223,6 +262,7 @@ private static IOrderedAsyncEnumerable ThenByAwaitCore(t #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ThenByAwaitWithCancellation functionality now exists as overloads of ThenBy.")] private static IOrderedAsyncEnumerable ThenByAwaitWithCancellationCore(this IOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) { if (source == null) @@ -232,6 +272,10 @@ private static IOrderedAsyncEnumerable ThenByAwaitWithCancellationCore< } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.thenbydescending?view=net-9.0-pp#system-linq-asyncenumerable-thenbydescending-2(system-linq-iorderedasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + // The method linked to above includes a comparer parameter with a default value of null. + /// /// Performs a subsequent ordering of the elements in a sequence in descending order, according to a key. /// @@ -248,6 +292,7 @@ public static IOrderedAsyncEnumerable ThenByDescending(t return source.CreateOrderedEnumerable(keySelector, comparer: null, descending: true); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Performs a subsequent ordering of the elements in a sequence in descending order, according to a key obtained by invoking a transform function on each element and awaiting the result. @@ -259,6 +304,7 @@ public static IOrderedAsyncEnumerable ThenByDescending(t /// An ordered async-enumerable sequence whose elements are sorted in descending order according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use ThenByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ThenByDescendingAwait functionality now exists as overloads of ThenByDescending.")] private static IOrderedAsyncEnumerable ThenByDescendingAwaitCore(this IOrderedAsyncEnumerable source, Func> keySelector) { if (source == null) @@ -269,6 +315,7 @@ private static IOrderedAsyncEnumerable ThenByDescendingAwaitCore ThenByDescendingAwaitWithCancellationCore(this IOrderedAsyncEnumerable source, Func> keySelector) { if (source == null) @@ -278,6 +325,9 @@ private static IOrderedAsyncEnumerable ThenByDescendingAwaitWithCancell } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.thenbydescending?view=net-9.0-pp#system-linq-asyncenumerable-thenbydescending-2(system-linq-iorderedasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-icomparer((-1))) + /// /// Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. /// @@ -295,6 +345,7 @@ public static IOrderedAsyncEnumerable ThenByDescending(t return source.CreateOrderedEnumerable(keySelector, comparer, descending: true); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. The keys are obtained by invoking a transform function on each element and awaiting the result. @@ -307,6 +358,7 @@ public static IOrderedAsyncEnumerable ThenByDescending(t /// An ordered async-enumerable sequence whose elements are sorted in descending order according to a key. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use ThenByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ThenByDescendingAwait functionality now exists as overloads of ThenByDescending.")] private static IOrderedAsyncEnumerable ThenByDescendingAwaitCore(this IOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) { if (source == null) @@ -317,6 +369,7 @@ private static IOrderedAsyncEnumerable ThenByDescendingAwaitCore ThenByDescendingAwaitWithCancellationCore(this IOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) { if (source == null) @@ -326,4 +379,5 @@ private static IOrderedAsyncEnumerable ThenByDescendingAwaitWithCancell } #endif } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs index 54df9aa8f..717fcc925 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/OrderedAsyncEnumerable.cs @@ -9,6 +9,7 @@ namespace System.Linq { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES // NB: Large portions of the implementation are based on https://github.com/dotnet/corefx/blob/master/src/System.Linq/src/System/Linq/OrderedEnumerable.cs. internal abstract class OrderedAsyncEnumerable : AsyncIterator, IOrderedAsyncEnumerable, IAsyncPartition @@ -1216,4 +1217,5 @@ internal override async ValueTask SetElement(TElement element, CancellationToken } } #endif +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Range.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Range.cs index 013a1b00a..77bf5a21b 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Range.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Range.cs @@ -11,6 +11,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.range?view=net-9.0-pp + /// /// Generates an async-enumerable sequence of integral numbers within a specified range. /// @@ -144,5 +147,6 @@ async ValueTask Core() } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Repeat.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Repeat.cs index b89feb64c..45f12bace 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Repeat.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Repeat.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.repeat?view=net-9.0-pp + /// /// Generates an async-enumerable sequence that repeats the given element the specified number of times. /// @@ -99,5 +102,6 @@ protected override async ValueTask MoveNextCore() return false; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Reverse.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Reverse.cs index 13f314d23..54732b0d1 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Reverse.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Reverse.cs @@ -11,6 +11,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.reverse?view=net-9.0-pp + /// /// Inverts the order of the elements in a sequence. /// @@ -115,5 +118,6 @@ protected override async ValueTask MoveNextCore() return false; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs index bcd1b9ffc..493882c47 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.select?view=net-9.0-pp#system-linq-asyncenumerable-select-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))) + /// /// Projects each element of an async-enumerable sequence into a new form. /// @@ -34,6 +37,8 @@ public static IAsyncEnumerable Select(this IAsyncEnum }; } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.select?view=net-9.0-pp#system-linq-asyncenumerable-select-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-int32-1))) + /// /// Projects each element of an async-enumerable sequence into a new form by incorporating the element's index. /// @@ -67,6 +72,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Projects each element of an async-enumerable sequence into a new form by applying an asynchronous selector function to each member of the source sequence and awaiting the result. @@ -78,6 +84,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence whose elements are the result of invoking the transform function on each element of the source sequence and awaiting the result. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectAwait functionality now exists as overloads of Select.")] private static IAsyncEnumerable SelectAwaitCore(this IAsyncEnumerable source, Func> selector) { if (source == null) @@ -95,6 +102,7 @@ private static IAsyncEnumerable SelectAwaitCore(this #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectAwaitWithCancellation functionality now exists as overloads of Select.")] private static IAsyncEnumerable SelectAwaitWithCancellationCore(this IAsyncEnumerable source, Func> selector) { if (source == null) @@ -121,6 +129,7 @@ private static IAsyncEnumerable SelectAwaitWithCancellationCoreAn async-enumerable sequence whose elements are the result of invoking the transform function on each element and its index of the source sequence and awaiting the result. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectAwait functionality now exists as overloads of Select.")] private static IAsyncEnumerable SelectAwaitCore(this IAsyncEnumerable source, Func> selector) { if (source == null) @@ -148,6 +157,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectAwaitWithCancellation functionality now exists as overloads of Select.")] private static IAsyncEnumerable SelectAwaitWithCancellationCore(this IAsyncEnumerable source, Func> selector) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs index e70b194cf..0b0d190c8 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.selectmany?view=net-9.0-pp#system-linq-asyncenumerable-selectmany-3(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-collections-generic-iasyncenumerable((-1))))-system-func((-0-1-2))) + /// /// Projects each element of an async-enumerable sequence to an async-enumerable sequence and merges the resulting async-enumerable sequences into one async-enumerable sequence. /// @@ -28,6 +31,7 @@ public static IAsyncEnumerable SelectMany(this IAsync return new SelectManyAsyncIterator(source, selector); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES // REVIEW: Should we keep these overloads that return ValueTask>? One could argue the selector is async twice. @@ -41,6 +45,7 @@ public static IAsyncEnumerable SelectMany(this IAsync /// An async-enumerable sequence whose elements are the result of invoking the one-to-many transform function on each element of the source sequence and awaiting the result. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwait functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitCore(this IAsyncEnumerable source, Func>> selector) { if (source == null) @@ -53,6 +58,7 @@ private static IAsyncEnumerable SelectManyAwaitCore(t #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwaitWithCancellation functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitWithCancellationCore(this IAsyncEnumerable source, Func>> selector) { if (source == null) @@ -64,6 +70,9 @@ private static IAsyncEnumerable SelectManyAwaitWithCancellationCore /// Projects each element of an async-enumerable sequence to an async-enumerable sequence by incorporating the element's index and merges the resulting async-enumerable sequences into one async-enumerable sequence. /// @@ -102,6 +111,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Projects each element of an async-enumerable sequence into an async-enumerable sequence by incorporating the element's index and merges the resulting async-enumerable sequences into an async-enumerable sequence. @@ -113,6 +123,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence who's elements are the result of invoking the one-to-many transform function on each element of the source sequence and awaiting the result. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwait functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitCore(this IAsyncEnumerable source, Func>> selector) { if (source == null) @@ -145,6 +156,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwaitWithCancellation functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitWithCancellationCore(this IAsyncEnumerable source, Func>> selector) { if (source == null) @@ -176,6 +188,9 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.selectmany?view=net-9.0-pp#system-linq-asyncenumerable-selectmany-3(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-collections-generic-iasyncenumerable((-1))))-system-func((-0-1-2))) + /// /// Projects each element of an async-enumerable sequence to an async-enumerable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one async-enumerable sequence. /// @@ -211,6 +226,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Projects each element of an async-enumerable sequence to an async-enumerable sequence by awaiting the result of a transform function, invokes the result selector for each of the source elements and each of the corrasponding inner-sequence's elements and awaits the result, and merges the results into one async-enumerable sequence. @@ -224,6 +240,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence, awaiting the result, applying to each element of the intermediate sequences along with their corrasponding source element and awaiting the result. /// , , or is . [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwait functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitCore(this IAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) { if (source == null) @@ -251,6 +268,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwaitWithCancellation functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitWithCancellationCore(this IAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) { if (source == null) @@ -277,6 +295,9 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.selectmany?view=net-9.0-pp#system-linq-asyncenumerable-selectmany-3(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-int32-system-collections-generic-ienumerable((-1))))-system-func((-0-1-2))) + /// /// Projects each element of an async-enumerable sequence to an async-enumerable sequence by incorporating the element's index, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one async-enumerable sequence. /// @@ -319,6 +340,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Projects each element of an async-enumerable sequence to an async-enumerable sequence by awaiting the result of a transform function that incorporates each element's index, @@ -333,6 +355,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence, awaiting the result, applying to each element of the intermediate sequences olong with their corrasponding source element and awaiting the result. /// , , or is . [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwait functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitCore(this IAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) { if (source == null) @@ -367,6 +390,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SelectManyAwaitWithCancellation functionality now exists as overloads of SelectMany.")] private static IAsyncEnumerable SelectManyAwaitWithCancellationCore(this IAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SequenceEqual.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SequenceEqual.cs index 801cd734b..df2fb804b 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SequenceEqual.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SequenceEqual.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.sequenceequalasync?view=net-9.0-pp + // The method above covers the next two overloads because it supplies a default null value for comparer. + /// /// Determines whether two sequences are equal by comparing the elements pairwise. /// @@ -84,5 +88,6 @@ static async ValueTask Core(IAsyncEnumerable first, IAsyncEnumera return !await e2.MoveNextAsync(); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs index 8f2aef284..aa0ae170e 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.singleasync?view=net-9.0-pp#system-linq-asyncenumerable-singleasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns the only element of an async-enumerable sequence, and reports an exception if there is not exactly one element in the async-enumerable sequence. /// @@ -56,6 +59,8 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.singleasync?view=net-9.0-pp#system-linq-asyncenumerable-singleasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns the only element of an async-enumerable sequence that satisfies the condition in the predicate, and reports an exception if there is not exactly one element in the async-enumerable sequence. /// @@ -101,6 +106,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Returns the only element of an async-enumerable sequence that satisfies the condition in the asynchronous predicate, and reports an exception if there is not exactly one element in the async-enumerable sequence that matches the predicate. @@ -113,6 +119,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func or is null. /// (Asynchronous) No element satisfies the condition in the predicate. -or- More than one element satisfies the condition in the predicate. -or- The source sequence is empty. [GenerateAsyncOverload] + [Obsolete("Use SingleAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SingleAwaitAsync functionality now exists as overloads of SingleAsync.")] private static ValueTask SingleAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -151,6 +158,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SingleAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SingleOrDefault.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SingleOrDefault.cs index 08e0c7e9e..c7aa9edcd 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SingleOrDefault.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SingleOrDefault.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.singleordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-singleordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-threading-cancellationtoken) + /// /// Returns the only element of an async-enumerable sequence, or a default value if the async-enumerable sequence is empty; this method reports an exception if there is more than one element in the async-enumerable sequence. /// @@ -57,6 +60,8 @@ public static partial class AsyncEnumerable } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.singleordefaultasync?view=net-9.0-pp#system-linq-asyncenumerable-singleordefaultasync-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))-system-threading-cancellationtoken) + /// /// Returns the only element of an async-enumerable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the async-enumerable sequence. /// @@ -102,6 +107,7 @@ public static partial class AsyncEnumerable return default; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Returns the only element of an async-enumerable sequence that satisfies the condition in the asynchronous predicate, or a default value if no such element exists, and reports an exception if there is more than one element in the async-enumerable sequence that matches the predicate. @@ -114,6 +120,7 @@ public static partial class AsyncEnumerable /// or is null. /// (Asynchronous) More than one element satisfies the condition in the predicate. [GenerateAsyncOverload] + [Obsolete("Use SingleOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SingleOrDefaultAwaitAsync functionality now exists as overloads of SingleOrDefaultAsync.")] private static ValueTask SingleOrDefaultAwaitAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) @@ -152,6 +159,7 @@ public static partial class AsyncEnumerable #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use SingleOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SingleOrDefaultAwaitWithCancellationAsync functionality now exists as overloads of SingleOrDefaultAsync.")] private static ValueTask SingleOrDefaultAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Skip.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Skip.cs index 8fd12a350..fb463e414 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Skip.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Skip.cs @@ -8,6 +8,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.skip?view=net-9.0-pp + /// /// Bypasses a specified number of elements in an async-enumerable sequence and then returns the remaining elements. /// @@ -44,5 +47,6 @@ public static IAsyncEnumerable Skip(this IAsyncEnumerable(source, count, -1); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipLast.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipLast.cs index fab55d968..b47f97ccd 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipLast.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipLast.cs @@ -11,6 +11,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.skiplast?view=net-9.0-pp + /// /// Bypasses a specified number of elements at the end of an async-enumerable sequence. /// @@ -68,5 +71,6 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, in } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipWhile.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipWhile.cs index a30e7bcfa..c5c03d38c 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipWhile.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SkipWhile.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.skipwhile?view=net-9.0-pp#system-linq-asyncenumerable-skipwhile-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))) + /// /// Bypasses elements in an async-enumerable sequence as long as a specified condition is true and then returns the remaining elements. /// @@ -50,6 +53,8 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.skipwhile?view=net-9.0-pp#system-linq-asyncenumerable-skipwhile-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-int32-system-boolean))) + /// /// Bypasses elements in an async-enumerable sequence as long as a specified condition is true and then returns the remaining elements. /// The element's index is used in the logic of the predicate function. @@ -96,6 +101,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Bypasses elements in an async-enumerable sequence as long as a condition is true, and then returns the remaining elements. @@ -106,6 +112,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence containing the elements in the source sequence starting at the first element that does not pass the test specified by the predicate. /// or is . [GenerateAsyncOverload] + [Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SkipWhileAwait functionality now exists as overloads of SkipWhile.")] private static IAsyncEnumerable SkipWhileAwaitCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -140,6 +147,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SkipWhileAwaitWithCancellation functionality now exists as overloads of SkipWhile.")] private static IAsyncEnumerable SkipWhileAwaitWithCancellationCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -183,6 +191,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence containing the elements in the source sequence starting at the first element that does not pass the test specified by the predicate. /// or is . [GenerateAsyncOverload] + [Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SkipWhileAwait functionality now exists as overloads of SkipWhile.")] private static IAsyncEnumerable SkipWhileAwaitCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -223,6 +232,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the SkipWhileAwaitWithCancellation functionality now exists as overloads of SkipWhile.")] private static IAsyncEnumerable SkipWhileAwaitWithCancellationCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.cs index cd9be75fa..bd9000a0c 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.cs @@ -10,6 +10,7 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values. /// @@ -40,6 +41,7 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationToken return sum; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -51,6 +53,7 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationToken /// An async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -78,16 +81,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -117,6 +111,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -146,6 +141,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -176,6 +172,7 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationTok return sum; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -187,6 +184,7 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationTok /// An async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -214,16 +212,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -253,6 +242,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -282,6 +272,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -309,6 +300,7 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationT return sum; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -320,6 +312,7 @@ static async ValueTask Core(IAsyncEnumerable source, CancellationT /// An async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -344,16 +337,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -380,6 +364,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -406,6 +391,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -433,6 +419,7 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellatio return sum; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -444,6 +431,7 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellatio /// An async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -468,16 +456,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -504,6 +483,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -530,6 +510,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -557,6 +538,7 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat return sum; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -568,6 +550,7 @@ static async ValueTask Core(IAsyncEnumerable source, Cancellat /// An async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -592,16 +575,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -628,6 +602,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -654,6 +629,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -684,6 +660,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -695,6 +672,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncAn async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -722,16 +700,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -761,6 +730,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -790,6 +760,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -820,6 +791,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -831,6 +803,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncAn async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -858,16 +831,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -897,6 +861,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -926,6 +891,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -953,6 +919,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -964,6 +931,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncAn async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -988,16 +956,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -1024,6 +983,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -1050,6 +1010,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -1077,6 +1038,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -1088,6 +1050,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncAn async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1112,16 +1075,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -1148,6 +1102,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -1174,6 +1129,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values. /// @@ -1201,6 +1157,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -1212,6 +1169,7 @@ static async ValueTask Core(IAsyncEnumerable source, FuncAn async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask SumAsync(this IAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) { if (source == null) @@ -1236,16 +1194,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func - /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the source sequence and awaiting the result. - /// - /// The type of elements in the source sequence. - /// A sequence of values that are used to calculate a sum. - /// An asynchronous transform function to apply to each element. - /// The optional cancellation token to be used for cancelling the sequence at any time. - /// A ValueTask containing the sum of the values in the source sequence. - /// or is . - /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] [GenerateAsyncOverload] private static ValueTask SumAwaitAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { @@ -1272,6 +1221,7 @@ static async ValueTask Core(IAsyncEnumerable source, Func SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.tt b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.tt index d765430fe..a24268e63 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.tt +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.tt @@ -40,6 +40,7 @@ foreach (var o in os) typeStr = "Nullable{" + o.type.Substring(0, 1).ToUpper() + o.type.Substring(1, o.type.Length - 2) + "}"; } #> +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values. /// @@ -83,6 +84,7 @@ else return sum; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. @@ -94,6 +96,7 @@ else /// An async-enumerable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static ValueTask<<#=o.type#>> SumAsync(this IAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { if (source == null) @@ -134,7 +137,9 @@ else } } - internal static ValueTask<<#=o.type#>> SumAwaitAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] + [GenerateAsyncOverload] + private static ValueTask<<#=o.type#>> SumAwaitAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); @@ -175,7 +180,9 @@ else } #if !NO_DEEP_CANCELLATION - internal static ValueTask<<#=o.type#>> SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) + [Obsolete("Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] + [GenerateAsyncOverload] + private static ValueTask<<#=o.type#>> SumAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) { if (source == null) throw Error.ArgumentNull(nameof(source)); diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Take.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Take.cs index b5820dccf..b7d9b547f 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Take.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Take.cs @@ -8,6 +8,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.take?view=net-9.0-pp#system-linq-asyncenumerable-take-1(system-collections-generic-iasyncenumerable((-0))-system-int32) + /// /// Returns a specified number of contiguous elements from the start of an async-enumerable sequence. /// @@ -37,5 +41,6 @@ public static IAsyncEnumerable Take(this IAsyncEnumerable(source, 0, count - 1); } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeLast.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeLast.cs index 19f27bc4b..76c1a641e 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeLast.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeLast.cs @@ -11,6 +11,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.takelast?view=net-9.0-pp + /// /// Returns a specified number of contiguous elements from the end of an async-enumerable sequence. /// @@ -77,5 +81,6 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, in while (queue.Count > 0); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeWhile.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeWhile.cs index d214e48c2..2f34b0dbf 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeWhile.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/TakeWhile.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.takewhile?view=net-9.0-pp#system-linq-asyncenumerable-takewhile-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))) + /// /// Returns elements from an async-enumerable sequence as long as a specified condition is true. /// @@ -41,6 +44,8 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.takewhile?view=net-9.0-pp#system-linq-asyncenumerable-takewhile-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-int32-system-boolean))) + /// /// Returns elements from an async-enumerable sequence as long as a specified condition is true. /// The element's index is used in the logic of the predicate function. @@ -79,6 +84,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Returns elements from an async-enumerable sequence as long as a specified condition is true. @@ -89,6 +95,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the TakeWhileAwait functionality now exists as overloads of TakeWhile.")] private static IAsyncEnumerable TakeWhileAwaitCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -114,6 +121,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the TakeWhileAwaitWithCancellation functionality now exists as overloads of TakeWhile.")] private static IAsyncEnumerable TakeWhileAwaitWithCancellationCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -148,6 +156,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the TakeWhileAwait functionality now exists as overloads of TakeWhile.")] private static IAsyncEnumerable TakeWhileAwaitCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -180,6 +189,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the TakeWhileAwaitWithCancellation functionality now exists as overloads of TakeWhile.")] private static IAsyncEnumerable TakeWhileAwaitWithCancellationCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToArray.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToArray.cs index 7b731b8ea..34009ae90 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToArray.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToArray.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.toarrayasync?view=net-9.0-pp + /// /// Creates an array from an async-enumerable sequence. /// @@ -29,5 +32,6 @@ public static ValueTask ToArrayAsync(this IAsyncEnumerable /// Converts an observable sequence to an async-enumerable sequence. /// @@ -218,5 +225,6 @@ private Task Resume() } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.Task.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.Task.cs index 400289b05..61e6f23e9 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.Task.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.Task.cs @@ -9,6 +9,12 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // Moved to AsyncEnumerableEx in System.Interactive.Async. + // System.Linq.AsyncEnumerable has chosen not to implement this. We continue to implement this because + // we believe it is a useful feature, but since it's now in the category of LINQ-adjacent functionality + // not built into the .NET runtime libraries, it now lives in System.Interactive.Async. + /// /// Converts a task to an async-enumerable sequence. /// @@ -44,5 +50,6 @@ protected override async ValueTask MoveNextCore() return false; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.cs index 483f45b0b..b3d1b69e0 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToAsyncEnumerable.cs @@ -9,6 +9,7 @@ namespace System.Linq { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES public static partial class AsyncEnumerable { /// @@ -301,4 +302,5 @@ public ValueTask GetCountAsync(bool onlyIfCheap, CancellationToken cancella bool ICollection.IsReadOnly => _source.IsReadOnly; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs index 97cfedf87..0fa9fcb3e 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToDictionary.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.todictionaryasync?view=net-9.0-pp#system-linq-asyncenumerable-todictionaryasync-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-iequalitycomparer((-1))-system-threading-cancellationtoken) + // That one overload covers the next two methods, because it supplieds a default comparer. + /// /// Creates a dictionary from an async-enumerable sequence according to a specified key selector function. /// @@ -59,6 +63,7 @@ static async ValueTask> Core(IAsyncEnumerable return d; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Creates a dictionary from an async-enumerable sequence by invoking a key-selector function on each element and awaiting the result. @@ -72,6 +77,7 @@ static async ValueTask> Core(IAsyncEnumerable /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDictionaryAsync.")] private static ValueTask> ToDictionaryAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore(source, keySelector, comparer: null, cancellationToken); @@ -88,6 +94,7 @@ private static ValueTask> ToDictionaryAwaitAsyncCore or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDictionaryAsync.")] private static ValueTask> ToDictionaryAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) where TKey : notnull { if (source == null) @@ -114,10 +121,12 @@ static async ValueTask> Core(IAsyncEnumerable #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToDictionaryAwaitWithCancellationAsync functionality now exists as overloads of ToDictionaryAsync.")] private static ValueTask> ToDictionaryAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore(source, keySelector, comparer: null, cancellationToken); [GenerateAsyncOverload] + [Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToDictionaryAwaitWithCancellationAsync functionality now exists as overloads of ToDictionaryAsync.")] private static ValueTask> ToDictionaryAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) where TKey : notnull { if (source == null) @@ -143,6 +152,12 @@ static async ValueTask> Core(IAsyncEnumerable } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.todictionaryasync?view=net-9.0-pp#system-linq-asyncenumerable-todictionaryasync-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-iequalitycomparer((-1))-system-threading-cancellationtoken) + // The method above provides the functionality for each of the next two methods, although because it does so with a + // single method that provides a default null value for the comparer, it it's not a strict source-compatible + // replacement. But there's not much we can do about that. + /// /// Creates a dictionary from an async-enumerable sequence according to a specified key selector function, and an element selector function. /// @@ -199,6 +214,7 @@ static async ValueTask> Core(IAsyncEnumerable /// Creates a dictionary from an async-enumerable sequence using the specified asynchronous key and element selector functions. @@ -214,6 +230,7 @@ static async ValueTask> Core(IAsyncEnumerable or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDictionaryAsync.")] private static ValueTask> ToDictionaryAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore(source, keySelector, elementSelector, comparer: null, cancellationToken); @@ -232,6 +249,7 @@ private static ValueTask> ToDictionaryAwaitAsyncCore< /// or or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDictionaryAsync.")] private static ValueTask> ToDictionaryAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) where TKey : notnull { if (source == null) @@ -261,10 +279,12 @@ static async ValueTask> Core(IAsyncEnumerable> ToDictionaryAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore(source, keySelector, elementSelector, comparer: null, cancellationToken); [GenerateAsyncOverload] + [Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToDictionaryAwaitWithCancellationAsync functionality now exists as overloads of ToDictionaryAsync.")] private static ValueTask> ToDictionaryAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) where TKey : notnull { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToEnumerable.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToEnumerable.cs index ab6f99e7f..bddecb8a7 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToEnumerable.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToEnumerable.cs @@ -19,6 +19,7 @@ public static partial class AsyncEnumerable /// An async-enumerable sequence to convert to an enumerable sequence. /// The enumerable sequence containing the elements in the async-enumerable sequence. /// is null. + [Obsolete("IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and it does not implement this method because 'sync over async' of this kind is an anti-pattern. Please use a different strategy.")] public static IEnumerable ToEnumerable(this IAsyncEnumerable source) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs index 2bf7c487f..a2cb32a04 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToHashSet.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.tohashsetasync?view=net-9.0-pp + // That one overload covers the next two methods, because it supplieds a default comparer. + /// /// Creates a hash set from an async-enumerable sequence. /// @@ -51,5 +55,6 @@ static async ValueTask> Core(IAsyncEnumerable source, return set; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs index 6c50505d4..d5ed2294a 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs @@ -10,6 +10,9 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.tolistasync?view=net-9.0-pp + /// /// Creates a list from an async-enumerable sequence. /// @@ -41,5 +44,6 @@ static async ValueTask> Core(IAsyncEnumerable source, Can return list; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToLookup.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToLookup.cs index 4ad7f7e04..a57f98dea 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToLookup.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToLookup.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.tolookupasync?view=net-9.0-pp#system-linq-asyncenumerable-tolookupasync-2(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-collections-generic-iequalitycomparer((-1))-system-threading-cancellationtoken) + // That one overload covers the next two methods, because it supplieds a default comparer. + /// /// Creates a lookup from an async-enumerable sequence according to a specified key selector function. /// @@ -50,6 +54,7 @@ static async ValueTask> Core(IAsyncEnumerable so return await Internal.Lookup.CreateAsync(source, keySelector, comparer, cancellationToken).ConfigureAwait(false); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Creates a lookup from an async-enumerable sequence by invoking a key-selector function on each element and awaiting the result. @@ -63,6 +68,7 @@ static async ValueTask> Core(IAsyncEnumerable so /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore(source, keySelector, comparer:null, cancellationToken); @@ -79,6 +85,7 @@ private static ValueTask> ToLookupAwaitAsyncCore or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) { if (source == null) @@ -96,10 +103,12 @@ static async ValueTask> Core(IAsyncEnumerable so #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitWithCancellationAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore(source, keySelector, comparer: null, cancellationToken); [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitWithCancellationAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) { if (source == null) @@ -116,6 +125,10 @@ static async ValueTask> Core(IAsyncEnumerable so } #endif +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.tolookupasync?view=net-9.0-pp#system-linq-asyncenumerable-tolookupasync-3(system-collections-generic-iasyncenumerable((-0))-system-func((-0-1))-system-func((-0-2))-system-collections-generic-iequalitycomparer((-1))-system-threading-cancellationtoken) + // That one overload covers the next two methods, because it supplieds a default comparer. + /// /// Creates a lookup from an async-enumerable sequence according to a specified key selector function, and an element selector function. /// @@ -162,6 +175,7 @@ static async ValueTask> Core(IAsyncEnumerable s return await Internal.Lookup.CreateAsync(source, keySelector, elementSelector, comparer, cancellationToken).ConfigureAwait(false); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Creates a lookup from an async-enumerable sequence by invoking key and element selector functions on each source element and awaiting the results. @@ -177,6 +191,7 @@ static async ValueTask> Core(IAsyncEnumerable s /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore(source, keySelector, elementSelector, comparer: null, cancellationToken); @@ -195,6 +210,7 @@ private static ValueTask> ToLookupAwaitAsyncCore or or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) { if (source == null) @@ -214,10 +230,12 @@ static async ValueTask> Core(IAsyncEnumerable s #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitWithCancellationAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore(source, keySelector, elementSelector, comparer: null, cancellationToken); [GenerateAsyncOverload] + [Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ToLookupAwaitWithCancellationAsync functionality now exists as overloads of ToLookupAsync.")] private static ValueTask> ToLookupAwaitWithCancellationAsyncCore(this IAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToObservable.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToObservable.cs index 0e60ff045..464233d3a 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToObservable.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToObservable.cs @@ -8,6 +8,13 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + // Moved to AsyncEnumerableEx in System.Interactive.Async. + // System.Linq.AsyncEnumerable has chosen not to implement this. We continue to implement this because + // we believe it is a useful feature, but since it's now in the category of LINQ-adjacent functionality + // not built into the .NET runtime libraries, it now lives in System.Interactive.Async. + /// /// Converts an async-enumerable sequence to an observable sequence. /// @@ -79,5 +86,6 @@ async void Core() return ctd; } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs index 1537a05d2..7ac699ecb 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs @@ -11,6 +11,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.union?view=net-9.0-pp + // That one overload covers the next two methods, because it supplieds a default comparer. + /// /// Produces the set union of two sequences by using the default equality comparer. /// @@ -290,5 +294,6 @@ internal override UnionAsyncIterator Union(IAsyncEnumerable ne return new UnionAsyncIteratorN(_sources.Add(next), _headIndex + 1, _comparer); } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES } } diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Where.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Where.cs index 705b07ac6..f4b96f071 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Where.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Where.cs @@ -10,6 +10,10 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.where?view=net-9.0-pp#system-linq-asyncenumerable-where-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-boolean))) + /// /// Filters the elements of an async-enumerable sequence based on a predicate. /// @@ -34,6 +38,8 @@ public static IAsyncEnumerable Where(this IAsyncEnumerable(source, predicate); } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.where?view=net-9.0-pp#system-linq-asyncenumerable-where-1(system-collections-generic-iasyncenumerable((-0))-system-func((-0-system-int32-system-boolean))) + /// /// Filters the elements of an async-enumerable sequence based on a predicate by incorporating the element's index. /// @@ -69,6 +75,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu } } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES /// /// Filters the elements of an async-enumerable sequence based on an asynchronous predicate. @@ -79,6 +86,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu /// An async-enumerable sequence that contains elements from the input sequence that satisfy the condition. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the WhereAwait functionality now exists as overloads of Where.")] private static IAsyncEnumerable WhereAwaitCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -97,6 +105,7 @@ private static IAsyncEnumerable WhereAwaitCore(this IAsyncEnum #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the WhereAwaitWithCancellation functionality now exists as overloads of Where.")] private static IAsyncEnumerable WhereAwaitWithCancellationCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -123,6 +132,7 @@ private static IAsyncEnumerable WhereAwaitWithCancellationCore /// An async-enumerable sequence that contains elements from the input sequence that satisfy the condition. /// or is null. [GenerateAsyncOverload] + [Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the WhereAwait functionality now exists as overloads of Where.")] private static IAsyncEnumerable WhereAwaitCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) @@ -153,6 +163,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable source, Fu #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the WhereAwaitWithCancellation functionality now exists as overloads of Where.")] private static IAsyncEnumerable WhereAwaitWithCancellationCore(this IAsyncEnumerable source, Func> predicate) { if (source == null) diff --git a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Zip.cs b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Zip.cs index ec2a49f0d..6e06fb369 100644 --- a/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Zip.cs +++ b/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Zip.cs @@ -10,6 +10,18 @@ namespace System.Linq { public static partial class AsyncEnumerable { +#if INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.zip?view=net-9.0-pp#system-linq-asyncenumerable-zip-2(system-collections-generic-iasyncenumerable((-0))-system-collections-generic-iasyncenumerable((-1))) + + /// + /// Merges two async-enumerable sequences into one async-enumerable sequence by combining their elements in a pairwise fashion. + /// + /// The type of the elements in the first source sequence. + /// The type of the elements in the second source sequence. + /// First async-enumerable source. + /// Second async-enumerable source. + /// An async-enumerable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function. + /// or is null. public static IAsyncEnumerable<(TFirst First, TSecond Second)> Zip(this IAsyncEnumerable first, IAsyncEnumerable second) { if (first == null) @@ -31,6 +43,8 @@ public static partial class AsyncEnumerable } } + // https://learn.microsoft.com/en-us/dotnet/api/system.linq.asyncenumerable.zip?view=net-9.0-pp#system-linq-asyncenumerable-zip-3(system-collections-generic-iasyncenumerable((-0))-system-collections-generic-iasyncenumerable((-1))-system-func((-0-1-2))) + /// /// Merges two async-enumerable sequences into one async-enumerable sequence by combining their elements in a pairwise fashion. /// @@ -65,6 +79,8 @@ static async IAsyncEnumerable Core(IAsyncEnumerable first, IAsy } } +#endif // INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES + /// /// Merges two async-enumerable sequences into one async-enumerable sequence by combining their elements in a pairwise fashion. /// @@ -77,6 +93,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable first, IAsy /// An async-enumerable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function. /// or or is null. [GenerateAsyncOverload] + [Obsolete("Use Zip. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ZipAwait functionality now exists as overloads of Zip.")] private static IAsyncEnumerable ZipAwaitCore(this IAsyncEnumerable first, IAsyncEnumerable second, Func> selector) { if (first == null) @@ -102,6 +119,7 @@ static async IAsyncEnumerable Core(IAsyncEnumerable first, IAsy #if !NO_DEEP_CANCELLATION [GenerateAsyncOverload] + [Obsolete("Use Zip. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the ZipAwaitWithCancellation functionality now exists as overloads of Zip.")] private static IAsyncEnumerable ZipAwaitWithCancellationCore(this IAsyncEnumerable first, IAsyncEnumerable second, Func> selector) { if (first == null) diff --git a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsync.verified.cs b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsync.verified.cs index 067c12170..a186ec767 100644 --- a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsync.verified.cs +++ b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsync.verified.cs @@ -1,7 +1,7 @@ [assembly: System.CLSCompliant(true)] [assembly: System.Resources.NeutralResourcesLanguage("en-US")] [assembly: System.Runtime.InteropServices.ComVisible(false)] -[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")] namespace System.Linq { public static class AsyncEnumerableEx @@ -9,6 +9,17 @@ public static class AsyncEnumerableEx public static System.Collections.Generic.IAsyncEnumerable Amb(params System.Collections.Generic.IAsyncEnumerable[] sources) { } public static System.Collections.Generic.IAsyncEnumerable Amb(this System.Collections.Generic.IEnumerable> sources) { } public static System.Collections.Generic.IAsyncEnumerable Amb(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second) { } + public static System.Collections.Generic.IAsyncEnumerable AsAsyncEnumerable(this System.Collections.Generic.IAsyncEnumerable source) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable> Buffer(this System.Collections.Generic.IAsyncEnumerable source, int count) { } public static System.Collections.Generic.IAsyncEnumerable> Buffer(this System.Collections.Generic.IAsyncEnumerable source, int count, int skip) { } public static System.Collections.Generic.IAsyncEnumerable Catch(params System.Collections.Generic.IAsyncEnumerable[] sources) { } @@ -98,6 +109,9 @@ public static System.Collections.Generic.IAsyncEnumerable SelectMany StartWith(this System.Collections.Generic.IAsyncEnumerable source, params TSource[] values) { } public static System.Collections.Generic.IAsyncEnumerable Throw(System.Exception exception) { } public static System.Collections.Generic.IAsyncEnumerable Timeout(this System.Collections.Generic.IAsyncEnumerable source, System.TimeSpan timeout) { } + public static System.Collections.Generic.IAsyncEnumerable ToAsyncEnumerable(this System.IObservable source) { } + public static System.Collections.Generic.IAsyncEnumerable ToAsyncEnumerable(this System.Threading.Tasks.Task task) { } + public static System.IObservable ToObservable(this System.Collections.Generic.IAsyncEnumerable source) { } public static System.Collections.Generic.IAsyncEnumerable Using(System.Func> resourceFactory, System.Func>> enumerableFactory) where TResource : System.IDisposable { } public static System.Collections.Generic.IAsyncEnumerable Using(System.Func resourceFactory, System.Func> enumerableFactory) diff --git a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsyncProviders.verified.cs b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsyncProviders.verified.cs index a51d1bc7c..55fa24db5 100644 --- a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsyncProviders.verified.cs +++ b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemInteractiveAsyncProviders.verified.cs @@ -1,7 +1,7 @@ [assembly: System.CLSCompliant(true)] [assembly: System.Resources.NeutralResourcesLanguage("en-US")] [assembly: System.Runtime.InteropServices.ComVisible(false)] -[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")] namespace System.Linq { [System.Linq.LocalQueryMethodImplementationType(typeof(System.Linq.AsyncEnumerableEx))] diff --git a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsync.verified.cs b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsync.verified.cs index 2734bde4b..c81fb1a09 100644 --- a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsync.verified.cs +++ b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsync.verified.cs @@ -1,7 +1,7 @@ [assembly: System.CLSCompliant(true)] [assembly: System.Resources.NeutralResourcesLanguage("en-US")] [assembly: System.Runtime.InteropServices.ComVisible(false)] -[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName=".NET Standard 2.1")] namespace System.Collections.Generic { public static class AsyncEnumerator @@ -18,18 +18,45 @@ public static class AsyncEnumerable public static System.Threading.Tasks.ValueTask AggregateAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func accumulator, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask AggregateAsync(this System.Collections.Generic.IAsyncEnumerable source, TAccumulate seed, System.Func accumulator, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask AggregateAsync(this System.Collections.Generic.IAsyncEnumerable source, TAccumulate seed, System.Func accumulator, System.Func resultSelector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the AggregateAwaitAsync now exists as overloads of AggregateAsync.")] public static System.Threading.Tasks.ValueTask AggregateAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> accumulator, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the AggregateAwaitAsync functionality now exists as overloads of AggregateAs" + + "ync.")] public static System.Threading.Tasks.ValueTask AggregateAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, TAccumulate seed, System.Func> accumulator, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the AggregateAwaitAsync functionality now exists as overloads of AggregateAs" + + "ync.")] public static System.Threading.Tasks.ValueTask AggregateAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, TAccumulate seed, System.Func> accumulator, System.Func> resultSelector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the AggregateAwaitWithCancellationAsync functionality now exists as overload" + + "s of AggregateAsync.")] public static System.Threading.Tasks.ValueTask AggregateAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> accumulator, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the AggregateAwaitWithCancellationAsync functionality now exists as overload" + + "s of AggregateAsync.")] public static System.Threading.Tasks.ValueTask AggregateAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, TAccumulate seed, System.Func> accumulator, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AggregateAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the AggregateAwaitWithCancellationAsync functionality now exists as overload" + + "s of AggregateAsync.")] public static System.Threading.Tasks.ValueTask AggregateAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, TAccumulate seed, System.Func> accumulator, System.Func> resultSelector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask AllAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AllAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and th" + + "e AllAwaitAsync functionality now exists as overloads of All.")] public static System.Threading.Tasks.ValueTask AllAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AllAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and th" + + "e AllAwaitWithCancellationAsync functionality now exists as overloads of AllAsyn" + + "c.")] public static System.Threading.Tasks.ValueTask AllAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask AnyAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask AnyAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AnyAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and th" + + "e AnyAwaitAsync functionality now exists as overloads of AnyAsync.")] public static System.Threading.Tasks.ValueTask AnyAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use AnyAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and th" + + "e AnyAwaitWithCancellationAsync functionality now exists as overloads of AnyAsyn" + + "c.")] public static System.Threading.Tasks.ValueTask AnyAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable Append(this System.Collections.Generic.IAsyncEnumerable source, TSource element) { } public static System.Collections.Generic.IAsyncEnumerable AsAsyncEnumerable(this System.Collections.Generic.IAsyncEnumerable source) { } @@ -53,25 +80,45 @@ public static System.Threading.Tasks.ValueTask AverageAsync(this public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask AverageAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then AverageAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its AverageAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use AverageAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask AverageAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable Cast(this System.Collections.Generic.IAsyncEnumerable source) { } public static System.Collections.Generic.IAsyncEnumerable Concat(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second) { } @@ -79,7 +126,12 @@ public static System.Threading.Tasks.ValueTask ContainsAsync(this public static System.Threading.Tasks.ValueTask ContainsAsync(this System.Collections.Generic.IAsyncEnumerable source, TSource value, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask CountAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask CountAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use CountAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the CountAwaitAsync functionality now exists as overloads of CountAsync.")] public static System.Threading.Tasks.ValueTask CountAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use CountAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the CountAwaitWithCancellationAsync functionality now exists as overloads of Cou" + + "ntAsync.")] public static System.Threading.Tasks.ValueTask CountAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable Create(System.Func> getAsyncEnumerator) { } public static System.Collections.Generic.IAsyncEnumerable DefaultIfEmpty(this System.Collections.Generic.IAsyncEnumerable source) { } @@ -93,17 +145,34 @@ public static System.Collections.Generic.IAsyncEnumerable Except Except(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Collections.Generic.IEqualityComparer? comparer) { } public static System.Threading.Tasks.ValueTask FirstAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask FirstAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use FirstAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the FirstAwaitAsync functionality now exists as overloads of FirstAsync.")] public static System.Threading.Tasks.ValueTask FirstAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use FirstAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the FirstAwaitWithCancellationAsync functionality now exists as overloads of Fir" + + "stAsync.")] public static System.Threading.Tasks.ValueTask FirstAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask FirstOrDefaultAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask FirstOrDefaultAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use FirstOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumera" + + "ble, and the FirstOrDefaultAwaitAsync functionality now exists as overloads of F" + + "irstOrDefaultAsync.")] public static System.Threading.Tasks.ValueTask FirstOrDefaultAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use FirstOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumera" + + "ble, and the FirstOrDefaultAwaitWithCancellationAsync functionality now exists a" + + "s overloads of FirstOrDefaultAsync.")] public static System.Threading.Tasks.ValueTask FirstOrDefaultAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use the language support for async foreach instead.")] public static System.Threading.Tasks.Task ForEachAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Action action, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use the language support for async foreach instead.")] public static System.Threading.Tasks.Task ForEachAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Action action, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use the language support for async foreach instead.")] public static System.Threading.Tasks.Task ForEachAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func action, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use the language support for async foreach instead.")] public static System.Threading.Tasks.Task ForEachAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func action, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use the language support for async foreach instead.")] public static System.Threading.Tasks.Task ForEachAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func action, System.Threading.CancellationToken cancellationToken) { } + [System.Obsolete("Use the language support for async foreach instead.")] public static System.Threading.Tasks.Task ForEachAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func action, System.Threading.CancellationToken cancellationToken) { } public static System.Collections.Generic.IAsyncEnumerable> GroupBy(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector) { } public static System.Collections.Generic.IAsyncEnumerable> GroupBy(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? comparer) { } @@ -113,47 +182,122 @@ public static System.Collections.Generic.IAsyncEnumerable GroupBy GroupBy(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Func, TResult> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } public static System.Collections.Generic.IAsyncEnumerable GroupBy(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Func elementSelector, System.Func, TResult> resultSelector) { } public static System.Collections.Generic.IAsyncEnumerable GroupBy(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Func elementSelector, System.Func, TResult> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func, System.Threading.Tasks.ValueTask> resultSelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func, System.Threading.Tasks.ValueTask> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Func, System.Threading.Tasks.ValueTask> resultSelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwait functionality now exists as overloads of GroupBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Func, System.Threading.Tasks.ValueTask> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> resultSelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable> GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> resultSelector) { } + [System.Obsolete("Use GroupBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " GroupByAwaitWithCancellationAsync functionality now exists as overloads of Grou" + + "pBy.")] public static System.Collections.Generic.IAsyncEnumerable GroupByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } public static System.Collections.Generic.IAsyncEnumerable GroupJoin(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func, TResult> resultSelector) { } public static System.Collections.Generic.IAsyncEnumerable GroupJoin(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func, TResult> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he GroupJoinAwait functionality now exists as overloads of GroupJoin.")] public static System.Collections.Generic.IAsyncEnumerable GroupJoinAwait(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func, System.Threading.Tasks.ValueTask> resultSelector) { } + [System.Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he GroupJoinAwait functionality now exists as overloads of GroupJoin.")] public static System.Collections.Generic.IAsyncEnumerable GroupJoinAwait(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func, System.Threading.Tasks.ValueTask> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he GroupJoinAwaitWithCancellation functionality now exists as overloads of Group" + + "Join.")] public static System.Collections.Generic.IAsyncEnumerable GroupJoinAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> resultSelector) { } + [System.Obsolete("Use GroupJoin. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he GroupJoinAwaitWithCancellation functionality now exists as overloads of Group" + + "Join.")] public static System.Collections.Generic.IAsyncEnumerable GroupJoinAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } public static System.Collections.Generic.IAsyncEnumerable Intersect(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second) { } public static System.Collections.Generic.IAsyncEnumerable Intersect(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Collections.Generic.IEqualityComparer? comparer) { } public static System.Collections.Generic.IAsyncEnumerable Join(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector) { } public static System.Collections.Generic.IAsyncEnumerable Join(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func outerKeySelector, System.Func innerKeySelector, System.Func resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the Jo" + + "inAwait functionality now exists as overloads of Join.")] public static System.Collections.Generic.IAsyncEnumerable JoinAwait(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func> resultSelector) { } + [System.Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the Jo" + + "inAwait functionality now exists as overloads of Join.")] public static System.Collections.Generic.IAsyncEnumerable JoinAwait(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } + [System.Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the Jo" + + "inAwaitWithCancellation functionality now exists as overloads of Join.")] public static System.Collections.Generic.IAsyncEnumerable JoinAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func> resultSelector) { } + [System.Obsolete("Use Join. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the Jo" + + "inAwaitWithCancellation functionality now exists as overloads of Join.")] public static System.Collections.Generic.IAsyncEnumerable JoinAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable outer, System.Collections.Generic.IAsyncEnumerable inner, System.Func> outerKeySelector, System.Func> innerKeySelector, System.Func> resultSelector, System.Collections.Generic.IEqualityComparer? comparer) { } public static System.Threading.Tasks.ValueTask LastAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask LastAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use LastAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he LastAwaitAsync functionality now exists as overloads of LastAsync.")] public static System.Threading.Tasks.ValueTask LastAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use LastAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he LastAwaitWithCancellationAsync functionality now exists as overloads of LastA" + + "sync.")] public static System.Threading.Tasks.ValueTask LastAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask LastOrDefaultAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask LastOrDefaultAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use LastOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerab" + + "le, and the LastOrDefaultAwaitAsync functionality now exists as overloads of Las" + + "tOrDefaultAsync.")] public static System.Threading.Tasks.ValueTask LastOrDefaultAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use LastOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerab" + + "le, and the LastOrDefaultAwaitWithCancellationAsync functionality now exists as " + + "overloads of LastOrDefaultAsync.")] public static System.Threading.Tasks.ValueTask LastOrDefaultAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask LongCountAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask LongCountAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use LongCountAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the LongCountAwaitAsync functionality now exists as overloads of LongCountAs" + + "ync.")] public static System.Threading.Tasks.ValueTask LongCountAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use LongCountAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, " + + "and the LongCountAwaitWithCancellationAsync functionality now exists as overload" + + "s of LongCountAsync.")] public static System.Threading.Tasks.ValueTask LongCountAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MaxAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MaxAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } @@ -176,28 +320,97 @@ public static System.Threading.Tasks.ValueTask MaxAsync(this Sys public static System.Threading.Tasks.ValueTask MaxAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MaxAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MaxAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by the MaxAsync overload that took a selec" + + "tor callback now exists as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitAsync now exists as an overload" + + " of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MaxByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MaxAwaitWithCancellationAsync now exist" + + "s as an overload of MaxByAsync.")] public static System.Threading.Tasks.ValueTask MaxAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MinAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MinAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } @@ -220,41 +433,130 @@ public static System.Threading.Tasks.ValueTask MinAsync(this Sys public static System.Threading.Tasks.ValueTask MinAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MinAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask MinAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by the MinAsync overload that took a selec" + + "tor callback now exists as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitAsync now exists as an overload" + + " of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use MinByAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the functionality previously provided by MinAwaitWithCancellationAsync now exist" + + "s as an overload of MinByAsync.")] public static System.Threading.Tasks.ValueTask MinAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable OfType(this System.Collections.Generic.IAsyncEnumerable source) { } public static System.Linq.IOrderedAsyncEnumerable OrderBy(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector) { } public static System.Linq.IOrderedAsyncEnumerable OrderBy(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " OrderByAwait functionality now exists as overloads of OrderBy.")] public static System.Linq.IOrderedAsyncEnumerable OrderByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " OrderByAwait functionality now exists as overloads of OrderBy.")] public static System.Linq.IOrderedAsyncEnumerable OrderByAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " OrderByAwaitWithCancellation functionality now exists as overloads of OrderBy.")] public static System.Linq.IOrderedAsyncEnumerable OrderByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use OrderBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the" + + " OrderByAwaitWithCancellation functionality now exists as overloads of OrderBy.")] public static System.Linq.IOrderedAsyncEnumerable OrderByAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } public static System.Linq.IOrderedAsyncEnumerable OrderByDescending(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector) { } public static System.Linq.IOrderedAsyncEnumerable OrderByDescending(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the OrderByDescendingAwait functionality now exists as overloads of Order" + + "ByDescending.")] public static System.Linq.IOrderedAsyncEnumerable OrderByDescendingAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the OrderByDescendingAwait functionality now exists as overloads of Order" + + "ByDescending.")] public static System.Linq.IOrderedAsyncEnumerable OrderByDescendingAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the OrderByDescendingAwaitWithCancellation functionality now exists as ov" + + "erloads of OrderByDescending.")] public static System.Linq.IOrderedAsyncEnumerable OrderByDescendingAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use OrderByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the OrderByDescendingAwaitWithCancellation functionality now exists as ov" + + "erloads of OrderByDescending.")] public static System.Linq.IOrderedAsyncEnumerable OrderByDescendingAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } public static System.Collections.Generic.IAsyncEnumerable Prepend(this System.Collections.Generic.IAsyncEnumerable source, TSource element) { } public static System.Collections.Generic.IAsyncEnumerable Range(int start, int count) { } @@ -262,39 +564,88 @@ public static System.Collections.Generic.IAsyncEnumerable Repeat Reverse(this System.Collections.Generic.IAsyncEnumerable source) { } public static System.Collections.Generic.IAsyncEnumerable Select(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector) { } public static System.Collections.Generic.IAsyncEnumerable Select(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector) { } + [System.Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "SelectAwait functionality now exists as overloads of Select.")] public static System.Collections.Generic.IAsyncEnumerable SelectAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector) { } + [System.Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "SelectAwait functionality now exists as overloads of Select.")] public static System.Collections.Generic.IAsyncEnumerable SelectAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector) { } + [System.Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "SelectAwaitWithCancellation functionality now exists as overloads of Select.")] public static System.Collections.Generic.IAsyncEnumerable SelectAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector) { } + [System.Obsolete("Use Select. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "SelectAwaitWithCancellation functionality now exists as overloads of Select.")] public static System.Collections.Generic.IAsyncEnumerable SelectAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector) { } public static System.Collections.Generic.IAsyncEnumerable SelectMany(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector) { } public static System.Collections.Generic.IAsyncEnumerable SelectMany(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector) { } public static System.Collections.Generic.IAsyncEnumerable SelectMany(this System.Collections.Generic.IAsyncEnumerable source, System.Func> collectionSelector, System.Func resultSelector) { } public static System.Collections.Generic.IAsyncEnumerable SelectMany(this System.Collections.Generic.IAsyncEnumerable source, System.Func> collectionSelector, System.Func resultSelector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwait functionality now exists as overloads of SelectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> selector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwait functionality now exists as overloads of SelectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> selector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwait functionality now exists as overloads of SelectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> collectionSelector, System.Func> resultSelector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwait functionality now exists as overloads of SelectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> collectionSelector, System.Func> resultSelector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwaitWithCancellation functionality now exists as overloads of Sel" + + "ectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> selector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwaitWithCancellation functionality now exists as overloads of Sel" + + "ectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> selector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwaitWithCancellation functionality now exists as overloads of Sel" + + "ectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> collectionSelector, System.Func> resultSelector) { } + [System.Obsolete("Use SelectMany. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and " + + "the SelectManyAwaitWithCancellation functionality now exists as overloads of Sel" + + "ectMany.")] public static System.Collections.Generic.IAsyncEnumerable SelectManyAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func>> collectionSelector, System.Func> resultSelector) { } public static System.Threading.Tasks.ValueTask SequenceEqualAsync(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SequenceEqualAsync(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SingleAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SingleAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use SingleAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and" + + " the SingleAwaitAsync functionality now exists as overloads of SingleAsync.")] public static System.Threading.Tasks.ValueTask SingleAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use SingleAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and" + + " the SingleAwaitWithCancellationAsync functionality now exists as overloads of S" + + "ingleAsync.")] public static System.Threading.Tasks.ValueTask SingleAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SingleOrDefaultAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SingleOrDefaultAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use SingleOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumer" + + "able, and the SingleOrDefaultAwaitAsync functionality now exists as overloads of" + + " SingleOrDefaultAsync.")] public static System.Threading.Tasks.ValueTask SingleOrDefaultAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use SingleOrDefaultAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumer" + + "able, and the SingleOrDefaultAwaitWithCancellationAsync functionality now exists" + + " as overloads of SingleOrDefaultAsync.")] public static System.Threading.Tasks.ValueTask SingleOrDefaultAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable Skip(this System.Collections.Generic.IAsyncEnumerable source, int count) { } public static System.Collections.Generic.IAsyncEnumerable SkipLast(this System.Collections.Generic.IAsyncEnumerable source, int count) { } public static System.Collections.Generic.IAsyncEnumerable SkipWhile(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate) { } public static System.Collections.Generic.IAsyncEnumerable SkipWhile(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate) { } + [System.Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he SkipWhileAwait functionality now exists as overloads of SkipWhile.")] public static System.Collections.Generic.IAsyncEnumerable SkipWhileAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he SkipWhileAwait functionality now exists as overloads of SkipWhile.")] public static System.Collections.Generic.IAsyncEnumerable SkipWhileAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he SkipWhileAwaitWithCancellation functionality now exists as overloads of SkipW" + + "hile.")] public static System.Collections.Generic.IAsyncEnumerable SkipWhileAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use SkipWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he SkipWhileAwaitWithCancellation functionality now exists as overloads of SkipW" + + "hile.")] public static System.Collections.Generic.IAsyncEnumerable SkipWhileAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } @@ -306,55 +657,115 @@ public static System.Threading.Tasks.ValueTask SumAsync(this System.Colle public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete(@"Use Select then SumAsync. System.Linq.Async (a community-supported library) has been replaced by the (Microsoft supported) IAsyncEnumerable LINQ in System.Linq.AsyncEnumerable, and its SumAsync method does not include the overloads that take a selector. So you should use Select to perform the projection and then use SumAsync on the resulting sequence.")] public static System.Threading.Tasks.ValueTask SumAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> selector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable Take(this System.Collections.Generic.IAsyncEnumerable source, int count) { } public static System.Collections.Generic.IAsyncEnumerable TakeLast(this System.Collections.Generic.IAsyncEnumerable source, int count) { } public static System.Collections.Generic.IAsyncEnumerable TakeWhile(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate) { } public static System.Collections.Generic.IAsyncEnumerable TakeWhile(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate) { } + [System.Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he TakeWhileAwait functionality now exists as overloads of TakeWhile.")] public static System.Collections.Generic.IAsyncEnumerable TakeWhileAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he TakeWhileAwait functionality now exists as overloads of TakeWhile.")] public static System.Collections.Generic.IAsyncEnumerable TakeWhileAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he TakeWhileAwaitWithCancellation functionality now exists as overloads of TakeW" + + "hile.")] public static System.Collections.Generic.IAsyncEnumerable TakeWhileAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use TakeWhile. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and t" + + "he TakeWhileAwaitWithCancellation functionality now exists as overloads of TakeW" + + "hile.")] public static System.Collections.Generic.IAsyncEnumerable TakeWhileAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } public static System.Linq.IOrderedAsyncEnumerable ThenBy(this System.Linq.IOrderedAsyncEnumerable source, System.Func keySelector) { } public static System.Linq.IOrderedAsyncEnumerable ThenBy(this System.Linq.IOrderedAsyncEnumerable source, System.Func keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "ThenByAwait functionality now exists as overloads of ThenBy.")] public static System.Linq.IOrderedAsyncEnumerable ThenByAwait(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "ThenByAwait functionality now exists as overloads of ThenBy.")] public static System.Linq.IOrderedAsyncEnumerable ThenByAwait(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "ThenByAwaitWithCancellation functionality now exists as overloads of ThenBy.")] public static System.Linq.IOrderedAsyncEnumerable ThenByAwaitWithCancellation(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use ThenBy. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the " + + "ThenByAwaitWithCancellation functionality now exists as overloads of ThenBy.")] public static System.Linq.IOrderedAsyncEnumerable ThenByAwaitWithCancellation(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } public static System.Linq.IOrderedAsyncEnumerable ThenByDescending(this System.Linq.IOrderedAsyncEnumerable source, System.Func keySelector) { } public static System.Linq.IOrderedAsyncEnumerable ThenByDescending(this System.Linq.IOrderedAsyncEnumerable source, System.Func keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use ThenByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable" + + ", and the ThenByDescendingAwait functionality now exists as overloads of ThenByD" + + "escending.")] public static System.Linq.IOrderedAsyncEnumerable ThenByDescendingAwait(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use ThenByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable" + + ", and the ThenByDescendingAwait functionality now exists as overloads of ThenByD" + + "escending.")] public static System.Linq.IOrderedAsyncEnumerable ThenByDescendingAwait(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } + [System.Obsolete("Use ThenByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable" + + ", and the ThenByDescendingAwaitWithCancellation functionality now exists as over" + + "loads of ThenByDescending.")] public static System.Linq.IOrderedAsyncEnumerable ThenByDescendingAwaitWithCancellation(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector) { } + [System.Obsolete("Use ThenByDescending. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable" + + ", and the ThenByDescendingAwaitWithCancellation functionality now exists as over" + + "loads of ThenByDescending.")] public static System.Linq.IOrderedAsyncEnumerable ThenByDescendingAwaitWithCancellation(this System.Linq.IOrderedAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IComparer comparer) { } public static System.Threading.Tasks.ValueTask ToArrayAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Collections.Generic.IAsyncEnumerable ToAsyncEnumerable(this System.Collections.Generic.IEnumerable source) { } @@ -368,22 +779,49 @@ public static System.Collections.Generic.IAsyncEnumerable ToAsyncEnumer where TKey : notnull { } public static System.Threading.Tasks.ValueTask> ToDictionaryAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Func elementSelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDic" + + "tionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDic" + + "tionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDic" + + "tionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitAsync functionality now exists as overloads of ToDic" + + "tionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitWithCancellationAsync functionality now exists as ov" + + "erloads of ToDictionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitWithCancellationAsync functionality now exists as ov" + + "erloads of ToDictionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitWithCancellationAsync functionality now exists as ov" + + "erloads of ToDictionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("Use ToDictionaryAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerabl" + + "e, and the ToDictionaryAwaitWithCancellationAsync functionality now exists as ov" + + "erloads of ToDictionaryAsync.")] public static System.Threading.Tasks.ValueTask> ToDictionaryAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) where TKey : notnull { } + [System.Obsolete("IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and it does not impl" + + "ement this method because \'sync over async\' of this kind is an anti-pattern. Ple" + + "ase use a different strategy.")] public static System.Collections.Generic.IEnumerable ToEnumerable(this System.Collections.Generic.IAsyncEnumerable source) { } public static System.Threading.Tasks.ValueTask> ToHashSetAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask> ToHashSetAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } @@ -392,35 +830,74 @@ public static System.Collections.Generic.IEnumerable ToEnumerable> ToLookupAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask> ToLookupAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Func elementSelector, System.Threading.CancellationToken cancellationToken = default) { } public static System.Threading.Tasks.ValueTask> ToLookupAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func keySelector, System.Func elementSelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync" + + ".")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync" + + ".")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync" + + ".")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitAsync functionality now exists as overloads of ToLookupAsync" + + ".")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitWithCancellationAsync functionality now exists as overloads " + + "of ToLookupAsync.")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitWithCancellationAsync functionality now exists as overloads " + + "of ToLookupAsync.")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitWithCancellationAsync functionality now exists as overloads " + + "of ToLookupAsync.")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Threading.CancellationToken cancellationToken = default) { } + [System.Obsolete("Use ToLookupAsync. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, a" + + "nd the ToLookupAwaitWithCancellationAsync functionality now exists as overloads " + + "of ToLookupAsync.")] public static System.Threading.Tasks.ValueTask> ToLookupAwaitWithCancellationAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Func> keySelector, System.Func> elementSelector, System.Collections.Generic.IEqualityComparer? comparer, System.Threading.CancellationToken cancellationToken = default) { } public static System.IObservable ToObservable(this System.Collections.Generic.IAsyncEnumerable source) { } public static System.Collections.Generic.IAsyncEnumerable Union(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second) { } public static System.Collections.Generic.IAsyncEnumerable Union(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Collections.Generic.IEqualityComparer? comparer) { } public static System.Collections.Generic.IAsyncEnumerable Where(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate) { } public static System.Collections.Generic.IAsyncEnumerable Where(this System.Collections.Generic.IAsyncEnumerable source, System.Func predicate) { } + [System.Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the W" + + "hereAwait functionality now exists as overloads of Where.")] public static System.Collections.Generic.IAsyncEnumerable WhereAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the W" + + "hereAwait functionality now exists as overloads of Where.")] public static System.Collections.Generic.IAsyncEnumerable WhereAwait(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the W" + + "hereAwaitWithCancellation functionality now exists as overloads of Where.")] public static System.Collections.Generic.IAsyncEnumerable WhereAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } + [System.Obsolete("Use Where. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the W" + + "hereAwaitWithCancellation functionality now exists as overloads of Where.")] public static System.Collections.Generic.IAsyncEnumerable WhereAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable source, System.Func> predicate) { } [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { "First", "Second"})] public static System.Collections.Generic.IAsyncEnumerable> Zip(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second) { } public static System.Collections.Generic.IAsyncEnumerable Zip(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Func selector) { } + [System.Obsolete("Use Zip. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the Zip" + + "Await functionality now exists as overloads of Zip.")] public static System.Collections.Generic.IAsyncEnumerable ZipAwait(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Func> selector) { } + [System.Obsolete("Use Zip. IAsyncEnumerable LINQ is now in System.Linq.AsyncEnumerable, and the Zip" + + "AwaitWithCancellation functionality now exists as overloads of Zip.")] public static System.Collections.Generic.IAsyncEnumerable ZipAwaitWithCancellation(this System.Collections.Generic.IAsyncEnumerable first, System.Collections.Generic.IAsyncEnumerable second, System.Func> selector) { } } public interface IAsyncGrouping : System.Collections.Generic.IAsyncEnumerable { TKey Key { get; } } + [System.Obsolete("This interface was always unsupported, and the IAsyncEnumerable LINQ implement" + + "ation in System.Linq.AsyncEnumerable does not recognize it, so this no longer se" + + "rves a purpose")] public interface IAsyncIListProvider : System.Collections.Generic.IAsyncEnumerable { System.Threading.Tasks.ValueTask GetCountAsync(bool onlyIfCheap, System.Threading.CancellationToken cancellationToken); diff --git a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsyncQueryable.verified.cs b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsyncQueryable.verified.cs index ef82c6d2c..33196b616 100644 --- a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsyncQueryable.verified.cs +++ b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Api/ApiApprovalTests.SystemLinqAsyncQueryable.verified.cs @@ -1,7 +1,7 @@ [assembly: System.CLSCompliant(true)] [assembly: System.Resources.NeutralResourcesLanguage("en-US")] [assembly: System.Runtime.InteropServices.ComVisible(false)] -[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName=".NET Standard 2.1")] namespace System.Linq { public static class AsyncQueryable diff --git a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Tests.System.Interactive.ApiApprovals.csproj b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Tests.System.Interactive.ApiApprovals.csproj index a6022437c..56606a674 100644 --- a/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Tests.System.Interactive.ApiApprovals.csproj +++ b/Ix.NET/Source/Tests.System.Interactive.ApiApprovals/Tests.System.Interactive.ApiApprovals.csproj @@ -9,6 +9,19 @@ true + + + + + + + + SystemLinqAsyncEnumerable + + + + diff --git a/Ix.NET/Source/refs/System.Interactive.Providers/System.Interactive.Providers.csproj b/Ix.NET/Source/refs/System.Interactive.Providers/System.Interactive.Providers.csproj index d31936f4b..cd3b5ec82 100644 --- a/Ix.NET/Source/refs/System.Interactive.Providers/System.Interactive.Providers.csproj +++ b/Ix.NET/Source/refs/System.Interactive.Providers/System.Interactive.Providers.csproj @@ -11,7 +11,7 @@ See ../../Documentation/adr/0001-Ix-Ref-Assembly-Mismatches.md --> - net48;netstandard2.1;net6.0 + net48;netstandard2.1;net8.0 Ix;Interactive;Extensions;Enumerable diff --git a/Ix.NET/Source/refs/System.Interactive/System.Interactive.csproj b/Ix.NET/Source/refs/System.Interactive/System.Interactive.csproj index 47d0858a4..64ae74938 100644 --- a/Ix.NET/Source/refs/System.Interactive/System.Interactive.csproj +++ b/Ix.NET/Source/refs/System.Interactive/System.Interactive.csproj @@ -12,7 +12,7 @@ See ../../Documentation/adr/0001-Ix-Ref-Assembly-Mismatches.md --> - net48;netstandard2.1;net6.0 + net48;netstandard2.1;net8.0 Ix;Interactive;Extensions;Enumerable diff --git a/Ix.NET/Source/refs/System.Linq.Async/System.Linq.Async.csproj b/Ix.NET/Source/refs/System.Linq.Async/System.Linq.Async.csproj index c2de741b9..6c4f969fb 100644 --- a/Ix.NET/Source/refs/System.Linq.Async/System.Linq.Async.csproj +++ b/Ix.NET/Source/refs/System.Linq.Async/System.Linq.Async.csproj @@ -6,18 +6,20 @@ LINQ Standard Query Operators used to express queries over asynchronous enumerable sequences. System.Linq.Async Microsoft - net48;netstandard2.0;netstandard2.1;net6.0 + net48;netstandard2.0;netstandard2.1;net8.0 Enumerable;Asynchronous;LINQ System.Linq.Async - + - $(NoWarn);IDE0301;IDE0305 + IDE0305 wants to turn things like list.ToArray into [..list], which we don't find to be an improvement in readability. + CS0618: Type or member is obsolete - this whole library is essentially obsolete, so internal use of obsolete features is OK and widespread. + --> + $(NoWarn);IDE0301;IDE0305;CS0618 - + diff --git a/Ix.NET/Source/version.json b/Ix.NET/Source/version.json index 98c407497..9dd54b7ec 100644 --- a/Ix.NET/Source/version.json +++ b/Ix.NET/Source/version.json @@ -1,5 +1,5 @@ { - "version": "6.1.0-preview.{height}", + "version": "7.0.0-preview.{height}", "publicReleaseRefSpec": [ "^refs/heads/main$", // we release out of main "^refs/heads/rel/v\\d+\\.\\d+", // we also release branches starting with vN.N diff --git a/azure-pipelines.ix.yml b/azure-pipelines.ix.yml index 5940b7f1a..4f2e59ea8 100644 --- a/azure-pipelines.ix.yml +++ b/azure-pipelines.ix.yml @@ -32,14 +32,15 @@ stages: vmImage: windows-latest steps: - task: UseDotNet@2 - displayName: Use .NET Core 8.x SDK + displayName: Use .NET Core 10.x SDK inputs: - version: 8.x + version: 10.x + includePreviewVersions: true - task: UseDotNet@2 - displayName: .NET 6.0 runtime + displayName: .NET 8.0 runtime inputs: - version: '6.x' + version: '8.x' packageType: runtime - task: DotNetCoreCLI@2