From 8d4eadc540d85053a7426d27bf3c1c7a29068036 Mon Sep 17 00:00:00 2001 From: ig Date: Thu, 14 Sep 2023 14:22:26 +0200 Subject: [PATCH] Add SelectMany for IAsyncEnumerable + IEnumerable --- csharp/Lib/Utils/AsyncEnumerableEx.cs | 6 ++++++ csharp/Lib/Utils/Utils.csproj | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/csharp/Lib/Utils/AsyncEnumerableEx.cs b/csharp/Lib/Utils/AsyncEnumerableEx.cs index ffd069bdf..5bfc21015 100644 --- a/csharp/Lib/Utils/AsyncEnumerableEx.cs +++ b/csharp/Lib/Utils/AsyncEnumerableEx.cs @@ -5,6 +5,12 @@ namespace InnovEnergy.Lib.Utils; public static class AsyncEnumerableEx { + public static IAsyncEnumerable SelectMany(this IAsyncEnumerable ts, Func> map) + { + return ts.SelectMany(t => map(t).ToAsyncEnumerable()); + } + + public static async IAsyncEnumerable Throttle(this IAsyncEnumerable ts, TimeSpan dueTime, [EnumeratorCancellation] CancellationToken cancel = default) diff --git a/csharp/Lib/Utils/Utils.csproj b/csharp/Lib/Utils/Utils.csproj index 94dac3941..88d6cc0cc 100644 --- a/csharp/Lib/Utils/Utils.csproj +++ b/csharp/Lib/Utils/Utils.csproj @@ -1,8 +1,4 @@ - - Debug;Release;Release-Server - AnyCPU;linux-arm - @@ -12,6 +8,7 @@ +