Add SelectMany for IAsyncEnumerable + IEnumerable
This commit is contained in:
parent
3ce40b936a
commit
8d4eadc540
|
@ -5,6 +5,12 @@ namespace InnovEnergy.Lib.Utils;
|
|||
public static class AsyncEnumerableEx
|
||||
{
|
||||
|
||||
public static IAsyncEnumerable<R> SelectMany<T, R>(this IAsyncEnumerable<T> ts, Func<T, IEnumerable<R>> map)
|
||||
{
|
||||
return ts.SelectMany<T, R>(t => map(t).ToAsyncEnumerable());
|
||||
}
|
||||
|
||||
|
||||
public static async IAsyncEnumerable<T> Throttle<T>(this IAsyncEnumerable<T> ts,
|
||||
TimeSpan dueTime,
|
||||
[EnumeratorCancellation] CancellationToken cancel = default)
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configurations>Debug;Release;Release-Server</Configurations>
|
||||
<Platforms>AnyCPU;linux-arm</Platforms>
|
||||
</PropertyGroup>
|
||||
<Import Project="../InnovEnergy.Lib.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -12,6 +8,7 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="CliWrap" Version="3.6.0" />
|
||||
<PackageReference Include="DecimalMath.DecimalEx" Version="1.0.2" />
|
||||
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
|
||||
<PackageReference Include="System.Reactive.Linq" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
Loading…
Reference in New Issue