From cde7f046620633ef3ccbd7c9b0551a9c78fc10bc Mon Sep 17 00:00:00 2001 From: samaysar Date: Wed, 18 Dec 2024 21:50:15 +0100 Subject: [PATCH 1/5] adding ilist chunking without memory consumption - 1 --- README.md | 6 +- ....Extensions.SystemTypes.DataCollections.md | 67 ++++ .../DevFast.Net.Extensions.SystemTypes.md | 1 + ....Extensions.SystemTypes.DataCollections.md | 67 ++++ .../DevFast.Net.Extensions.SystemTypes.md | 1 + .../DevFast.Net.Extensions.Etc.Asynchro.md | 2 +- .../DevFast.Net.Extensions.Etc.Lambdas.md | 190 +++++----- .../DevFast.Net.Extensions.Etc.PipeLine.md | 328 +++++++++--------- ....Extensions.SystemTypes.DataCollections.md | 67 ++++ ....Net.Extensions.SystemTypes.Enumerables.md | 48 +-- .../DevFast.Net.Extensions.SystemTypes.md | 1 + ....Extensions.SystemTypes.DataCollections.md | 67 ++++ .../DevFast.Net.Extensions.SystemTypes.md | 1 + .../DevFast.Net.Extensions.Tests.csproj | 8 +- .../GlobalUsings.cs | 4 +- .../SystemTypes/ByteArraysTests.cs | 4 +- .../SystemTypes/DataCollectionsTests.cs | 131 +++++++ src/DevFast.Net.Extensions/GlobalUsings.cs | 3 +- .../SystemTypes/DataCollections.cs | 164 +++++++++ .../SystemTypes/Enumerables.cs | 50 +-- 20 files changed, 889 insertions(+), 321 deletions(-) create mode 100644 docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md create mode 100644 docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md create mode 100644 docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md create mode 100644 docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md create mode 100644 src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs create mode 100644 src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs diff --git a/README.md b/README.md index 56298a6..32d3ac0 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,6 @@ Similar ".TryTo" also exists on ReadOnlySpan<char> and ReadOnlySpan<byt - myByteArray.DoubleByteCapacity() returns new array with initial bytes but twice the capacity - myByteArray.CopyToSafe(...) copies bytes to targeted array -#### IEnumerable & IAsyncEnumerable with CancellationToken All the Way - - ForEach, ForEachAsync, ToBlockingEnumerable with CancellationToken - - CancellationToken support for SelectAsync, SkipAsync, TakeAsync, WhereAsync, CountAsync, ToChunksAsync etc. \ No newline at end of file +#### IEnumerable & IAsyncEnumerable with Token All the Way + - ForEach, ForEachAsync, ToBlockingEnumerable with Token + - Token support for SelectAsync, SkipAsync, TakeAsync, WhereAsync, CountAsync, ToChunksAsync etc. \ No newline at end of file diff --git a/docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md new file mode 100644 index 0000000..775275d --- /dev/null +++ b/docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -0,0 +1,67 @@ +#### [DevFast.Net.Extensions](index.md 'index') +### [DevFast.Net.Extensions.SystemTypes](DevFast.Net.Extensions.SystemTypes.md 'DevFast.Net.Extensions.SystemTypes') + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` +- *Methods* + - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections +### Methods + + + +## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method + +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). + +```csharp +public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +``` +#### Type parameters + + + +`T` +#### Parameters + + + +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') + +Collection on which chunks will be created. + + + +`maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +Maximum size of a given chunk + + + +`token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Cancellation token to observe. + + + +`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/docs/net6.0/DevFast.Net.Extensions.SystemTypes.md b/docs/net6.0/DevFast.Net.Extensions.SystemTypes.md index 314805e..6fa7744 100644 --- a/docs/net6.0/DevFast.Net.Extensions.SystemTypes.md +++ b/docs/net6.0/DevFast.Net.Extensions.SystemTypes.md @@ -7,6 +7,7 @@ Under this [namespace](https://docs.microsoft.com/en-us/dotnet/csharp/language-r | Classes | | | :--- | :--- | | [ByteArrays](DevFast.Net.Extensions.SystemTypes.ByteArrays.md 'DevFast.Net.Extensions.SystemTypes.ByteArrays') | Extension methods on Array of type [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte'). | +| [DataCollections](DevFast.Net.Extensions.SystemTypes.DataCollections.md 'DevFast.Net.Extensions.SystemTypes.DataCollections') | Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). | | [Enumerables](DevFast.Net.Extensions.SystemTypes.Enumerables.md 'DevFast.Net.Extensions.SystemTypes.Enumerables') | Extension methods on [System.Collections.Generic.IEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') and [System.Collections.Generic.IAsyncEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1'). | | [ReadableSpan](DevFast.Net.Extensions.SystemTypes.ReadableSpan.md 'DevFast.Net.Extensions.SystemTypes.ReadableSpan') | Extension methods on [System.ReadOnlySpan<>](https://docs.microsoft.com/en-us/dotnet/api/System.ReadOnlySpan-1 'System.ReadOnlySpan`1'). | | [Strings](DevFast.Net.Extensions.SystemTypes.Strings.md 'DevFast.Net.Extensions.SystemTypes.Strings') | Extension methods on [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String'). | diff --git a/docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md new file mode 100644 index 0000000..775275d --- /dev/null +++ b/docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -0,0 +1,67 @@ +#### [DevFast.Net.Extensions](index.md 'index') +### [DevFast.Net.Extensions.SystemTypes](DevFast.Net.Extensions.SystemTypes.md 'DevFast.Net.Extensions.SystemTypes') + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` +- *Methods* + - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections +### Methods + + + +## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method + +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). + +```csharp +public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +``` +#### Type parameters + + + +`T` +#### Parameters + + + +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') + +Collection on which chunks will be created. + + + +`maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +Maximum size of a given chunk + + + +`token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Cancellation token to observe. + + + +`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/docs/net8.0/DevFast.Net.Extensions.SystemTypes.md b/docs/net8.0/DevFast.Net.Extensions.SystemTypes.md index 314805e..6fa7744 100644 --- a/docs/net8.0/DevFast.Net.Extensions.SystemTypes.md +++ b/docs/net8.0/DevFast.Net.Extensions.SystemTypes.md @@ -7,6 +7,7 @@ Under this [namespace](https://docs.microsoft.com/en-us/dotnet/csharp/language-r | Classes | | | :--- | :--- | | [ByteArrays](DevFast.Net.Extensions.SystemTypes.ByteArrays.md 'DevFast.Net.Extensions.SystemTypes.ByteArrays') | Extension methods on Array of type [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte'). | +| [DataCollections](DevFast.Net.Extensions.SystemTypes.DataCollections.md 'DevFast.Net.Extensions.SystemTypes.DataCollections') | Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). | | [Enumerables](DevFast.Net.Extensions.SystemTypes.Enumerables.md 'DevFast.Net.Extensions.SystemTypes.Enumerables') | Extension methods on [System.Collections.Generic.IEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') and [System.Collections.Generic.IAsyncEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1'). | | [ReadableSpan](DevFast.Net.Extensions.SystemTypes.ReadableSpan.md 'DevFast.Net.Extensions.SystemTypes.ReadableSpan') | Extension methods on [System.ReadOnlySpan<>](https://docs.microsoft.com/en-us/dotnet/api/System.ReadOnlySpan-1 'System.ReadOnlySpan`1'). | | [Strings](DevFast.Net.Extensions.SystemTypes.Strings.md 'DevFast.Net.Extensions.SystemTypes.Strings') | Extension methods on [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String'). | diff --git a/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Asynchro.md b/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Asynchro.md index 1bd372f..a08d9d6 100644 --- a/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Asynchro.md +++ b/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Asynchro.md @@ -32,7 +32,7 @@ Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.O Gets a task that has already completed successfully. ```csharp -public static ValueTask CompletedTask { get; } +public static System.Threading.Tasks.ValueTask CompletedTask { get; } ``` #### Property Value diff --git a/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Lambdas.md b/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Lambdas.md index 49b75c2..593ffdd 100644 --- a/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Lambdas.md +++ b/docs/netstandard2.0/DevFast.Net.Extensions.Etc.Lambdas.md @@ -27,10 +27,10 @@ public static class Lambdas - **[Execute<TState>(this Action<TState>, TState, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.Execute_TState_(thisSystem.Action_TState_,TState,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.Execute(this System.Action, TState, System.Action)')** - **[ExecuteAsync(this Func<Task>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_System.Threading.Tasks.Task_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func)')** - **[ExecuteAsync(this Func<Task>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_System.Threading.Tasks.Task_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action)')** - - **[ExecuteAsync(this Func<ValueTask>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_ValueTask_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func)')** - - **[ExecuteAsync(this Func<ValueTask>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_ValueTask_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action)')** + - **[ExecuteAsync(this Func<ValueTask>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_System.Threading.Tasks.ValueTask_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func)')** + - **[ExecuteAsync(this Func<ValueTask>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action)')** - **[ExecuteAsync<TError>(this Func<Task>, Action<ExceptionDispatchInfo,TError>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.Task_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action)')** - - **[ExecuteAsync<TError>(this Func<ValueTask>, Action<ExceptionDispatchInfo,TError>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action)')** + - **[ExecuteAsync<TError>(this Func<ValueTask>, Action<ExceptionDispatchInfo,TError>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action)')** - **[ExecuteAsync<TOut,TError>(this Func<Task<TOut>>, Func<ExceptionDispatchInfo,TError,TOut>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TOut,TError_(thisSystem.Func_System.Threading.Tasks.Task_TOut__,System.Func_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TOut_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func>, System.Func, System.Action)')** - **[ExecuteAsync<TOut,TError>(this Func<ValueTask<TOut>>, Func<ExceptionDispatchInfo,TError,TOut>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TOut,TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_TOut__,System.Func_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TOut_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func>, System.Func, System.Action)')** - **[ExecuteAsync<TOut>(this Func<Task<TOut>>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TOut_(thisSystem.Func_System.Threading.Tasks.Task_TOut__) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func>)')** @@ -39,8 +39,8 @@ public static class Lambdas - **[ExecuteAsync<TOut>(this Func<ValueTask<TOut>>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TOut_(thisSystem.Func_System.Threading.Tasks.ValueTask_TOut__,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func>, System.Action)')** - **[ExecuteAsync<TState,TError>(this Func<TState,Task>, TState, Action<ExceptionDispatchInfo,TError,TState>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.Task_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action)')** - **[ExecuteAsync<TState,TError>(this Func<TState,Task>, TState, Action<ExceptionDispatchInfo,TError,TState>, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.Task_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action)')** - - **[ExecuteAsync<TState,TError>(this Func<TState,ValueTask>, TState, Action<ExceptionDispatchInfo,TError,TState>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action)')** - - **[ExecuteAsync<TState,TError>(this Func<TState,ValueTask>, TState, Action<ExceptionDispatchInfo,TError,TState>, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action)')** + - **[ExecuteAsync<TState,TError>(this Func<TState,ValueTask>, TState, Action<ExceptionDispatchInfo,TError,TState>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action)')** + - **[ExecuteAsync<TState,TError>(this Func<TState,ValueTask>, TState, Action<ExceptionDispatchInfo,TError,TState>, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action)')** - **[ExecuteAsync<TState,TOut,TError>(this Func<TState,Task<TOut>>, TState, Func<ExceptionDispatchInfo,TError,TState,TOut>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TOut,TError_(thisSystem.Func_TState,System.Threading.Tasks.Task_TOut__,TState,System.Func_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState,TOut_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func>, TState, System.Func, System.Action)')** - **[ExecuteAsync<TState,TOut,TError>(this Func<TState,Task<TOut>>, TState, Func<ExceptionDispatchInfo,TError,TState,TOut>, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TOut,TError_(thisSystem.Func_TState,System.Threading.Tasks.Task_TOut__,TState,System.Func_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState,TOut_,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func>, TState, System.Func, System.Action)')** - **[ExecuteAsync<TState,TOut,TError>(this Func<TState,ValueTask<TOut>>, TState, Func<ExceptionDispatchInfo,TError,TState,TOut>, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TOut,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_TOut__,TState,System.Func_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState,TOut_,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func>, TState, System.Func, System.Action)')** @@ -54,9 +54,9 @@ public static class Lambdas - **[ExecuteAsync<TState>(this Func<TState,Task>, TState)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.Task_,TState) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState)')** - **[ExecuteAsync<TState>(this Func<TState,Task>, TState, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.Task_,TState,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action)')** - **[ExecuteAsync<TState>(this Func<TState,Task>, TState, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.Task_,TState,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action)')** - - **[ExecuteAsync<TState>(this Func<TState,ValueTask>, TState)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState)')** - - **[ExecuteAsync<TState>(this Func<TState,ValueTask>, TState, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action)')** - - **[ExecuteAsync<TState>(this Func<TState,ValueTask>, TState, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action)')** + - **[ExecuteAsync<TState>(this Func<TState,ValueTask>, TState)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState)')** + - **[ExecuteAsync<TState>(this Func<TState,ValueTask>, TState, Action)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action)')** + - **[ExecuteAsync<TState>(this Func<TState,ValueTask>, TState, Action<TState>)](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_TState_) 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action)')** ## Lambdas Class @@ -811,18 +811,18 @@ Code to run inside finally clause #### Returns [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') - + ## Lambdas.ExecuteAsync(this Func) Method -Executes the given [lambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_ValueTask_).lambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func).lambda') asynchronously. +Executes the given [lambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_System.Threading.Tasks.ValueTask_).lambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func).lambda') asynchronously. ```csharp -public static ValueTask ExecuteAsync(this System.Func lambda); +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func lambda); ``` #### Parameters - + `lambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-1 'System.Func`1')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-1 'System.Func`1') @@ -831,27 +831,27 @@ Lambda to execute. #### Returns [System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') - + ## Lambdas.ExecuteAsync(this Func, Action) Method -Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_ValueTask_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action).asyncLambda') inside try block and returns -after excuting [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_ValueTask_,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action).finallyClause') inside finally. +Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action).asyncLambda') inside try block and returns +after excuting [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action).finallyClause') inside finally. NOTE: The code itself will NOT catch any [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception'). ```csharp -public static ValueTask ExecuteAsync(this System.Func asyncLambda, System.Action finallyClause); +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func asyncLambda, System.Action finallyClause); ``` #### Parameters - + `asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-1 'System.Func`1')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-1 'System.Func`1') Lambda to execute inside try clause - + `finallyClause` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') @@ -908,46 +908,46 @@ Code to run inside finally clause #### Returns [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') - + ## Lambdas.ExecuteAsync(this Func, Action, Action) Method -Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).asyncLambda') inside try block. -If any exception of type [TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).TError') (or -its derived types) occurs during [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).asyncLambda') -execution, relevant information is passed to [errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).errorHandler'). -If any [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).finallyClause') is provided, it will be executed inside finally. +Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).asyncLambda') inside try block. +If any exception of type [TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).TError') (or +its derived types) occurs during [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).asyncLambda') +execution, relevant information is passed to [errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).errorHandler'). +If any [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).finallyClause') is provided, it will be executed inside finally. NOTE: The code itself will NOT re-throw caught exception, but, -[errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).errorHandler') may itself re-throw those (e.g. +[errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).errorHandler') may itself re-throw those (e.g. [System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw 'System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw')), if needed. ```csharp -public static ValueTask ExecuteAsync(this System.Func asyncLambda, System.Action errorHandler, System.Action? finallyClause=null) +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func asyncLambda, System.Action errorHandler, System.Action? finallyClause=null) where TError : System.Exception; ``` #### Type parameters - + `TError` Exception type #### Parameters - + `asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-1 'System.Func`1')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-1 'System.Func`1') Lambda to execute inside try clause - + -`errorHandler` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-2 'System.Action`2')[System.Runtime.ExceptionServices.ExceptionDispatchInfo](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo 'System.Runtime.ExceptionServices.ExceptionDispatchInfo')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-2 'System.Action`2')[TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).TError')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-2 'System.Action`2') +`errorHandler` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-2 'System.Action`2')[System.Runtime.ExceptionServices.ExceptionDispatchInfo](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo 'System.Runtime.ExceptionServices.ExceptionDispatchInfo')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-2 'System.Action`2')[TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TError_(thisSystem.Func_System.Threading.Tasks.ValueTask_,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, System.Action, System.Action).TError')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-2 'System.Action`2') Error handler to invoke inside catch clause - + `finallyClause` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') @@ -1310,59 +1310,59 @@ Code to run inside finally clause #### Returns [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') - + ## Lambdas.ExecuteAsync(this Func, TState, Action, Action) Method -Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') inside try block and returns its value. -If any exception of type [TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError') (or -its derived types) occurs during [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') -execution, relevant information is passed to [errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') +Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') inside try block and returns its value. +If any exception of type [TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError') (or +its derived types) occurs during [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') +execution, relevant information is passed to [errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') to obtain the return value. -If any [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).finallyClause') is provided, it will be executed inside finally. +If any [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).finallyClause') is provided, it will be executed inside finally. NOTE: The code itself will NOT re-throw caught exception, but, -[errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') may itself re-throw those (e.g. +[errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') may itself re-throw those (e.g. [System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw 'System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw')), if needed. ```csharp -public static ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action errorHandler, System.Action? finallyClause=null) +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action errorHandler, System.Action? finallyClause=null) where TError : System.Exception; ``` #### Type parameters - + `TState` State type - + `TError` Exception type #### Parameters - + -`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda to execute inside try clause - + -`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState') +`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState') Lambda state - + -`errorHandler` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[System.Runtime.ExceptionServices.ExceptionDispatchInfo](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo 'System.Runtime.ExceptionServices.ExceptionDispatchInfo')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3') +`errorHandler` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[System.Runtime.ExceptionServices.ExceptionDispatchInfo](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo 'System.Runtime.ExceptionServices.ExceptionDispatchInfo')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3') Error handler to invoke inside catch clause - + `finallyClause` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') @@ -1371,61 +1371,61 @@ Code to run inside finally clause #### Returns [System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') - + ## Lambdas.ExecuteAsync(this Func, TState, Action, Action) Method -Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') inside try block and returns its value. -If any exception of type [TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError') (or -its derived types) occurs during [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') -execution, relevant information is passed to [errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') +Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') inside try block and returns its value. +If any exception of type [TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError') (or +its derived types) occurs during [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).asyncLambda') +execution, relevant information is passed to [errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') to obtain the return value. -And, [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).finallyClause') will be executed inside finally. +And, [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).finallyClause') will be executed inside finally. NOTE: The code itself will NOT re-throw caught exception, but, -[errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') may itself re-throw those (e.g. +[errorHandler](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).errorHandler 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).errorHandler') may itself re-throw those (e.g. [System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw 'System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw')), if needed. ```csharp -public static ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action errorHandler, System.Action finallyClause) +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action errorHandler, System.Action finallyClause) where TError : System.Exception; ``` #### Type parameters - + `TState` State type - + `TError` Exception type #### Parameters - + -`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda to execute inside try clause - + -`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState') +`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState') Lambda state - + -`errorHandler` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[System.Runtime.ExceptionServices.ExceptionDispatchInfo](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo 'System.Runtime.ExceptionServices.ExceptionDispatchInfo')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3') +`errorHandler` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[System.Runtime.ExceptionServices.ExceptionDispatchInfo](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.ExceptionServices.ExceptionDispatchInfo 'System.Runtime.ExceptionServices.ExceptionDispatchInfo')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TError](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TError 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TError')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-3 'System.Action`3') Error handler to invoke inside catch clause - + -`finallyClause` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') +`finallyClause` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState,TError_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_System.Runtime.ExceptionServices.ExceptionDispatchInfo,TError,TState_,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') Code to run inside finally clause @@ -2087,73 +2087,73 @@ Code to run inside finally clause #### Returns [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') - + ## Lambdas.ExecuteAsync(this Func, TState) Method -Executes the given [lambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState).lambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState).lambda') asynchronously. +Executes the given [lambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState).lambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState).lambda') asynchronously. ```csharp -public static ValueTask ExecuteAsync(this System.Func lambda, TState state); +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func lambda, TState state); ``` #### Type parameters - + `TState` State type #### Parameters - + -`lambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`lambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda to execute. - + -`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState).TState') +`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState).TState') Lambda state #### Returns [System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') - + ## Lambdas.ExecuteAsync(this Func, TState, Action) Method -Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).asyncLambda') inside try block and returns -after excuting [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).finallyClause') inside finally. +Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).asyncLambda') inside try block and returns +after excuting [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).finallyClause') inside finally. NOTE: The code itself will NOT catch any [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception'). ```csharp -public static ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action finallyClause); +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action finallyClause); ``` #### Type parameters - + `TState` State type #### Parameters - + -`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda to execute inside try clause - + -`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState') +`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState') Lambda state - + `finallyClause` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') @@ -2162,42 +2162,42 @@ Code to run inside finally clause #### Returns [System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') - + ## Lambdas.ExecuteAsync(this Func, TState, Action) Method -Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action_TState_).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).asyncLambda') inside try block and returns -after excuting [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action_TState_).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).finallyClause') inside finally. +Asynchronously executes [asyncLambda](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_TState_).asyncLambda 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).asyncLambda') inside try block and returns +after excuting [finallyClause](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_TState_).finallyClause 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).finallyClause') inside finally. NOTE: The code itself will NOT catch any [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception'). ```csharp -public static ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action finallyClause); +public static System.Threading.Tasks.ValueTask ExecuteAsync(this System.Func asyncLambda, TState state, System.Action finallyClause); ``` #### Type parameters - + `TState` State type #### Parameters - + -`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`asyncLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda to execute inside try clause - + -`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState') +`state` [TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState') Lambda state - + -`finallyClause` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,ValueTask_,TState,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') +`finallyClause` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[TState](DevFast.Net.Extensions.Etc.Lambdas.md#DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync_TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_,TState,System.Action_TState_).TState 'DevFast.Net.Extensions.Etc.Lambdas.ExecuteAsync(this System.Func, TState, System.Action).TState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') Code to run inside finally clause diff --git a/docs/netstandard2.0/DevFast.Net.Extensions.Etc.PipeLine.md b/docs/netstandard2.0/DevFast.Net.Extensions.Etc.PipeLine.md index e13fda5..b8f0ba3 100644 --- a/docs/netstandard2.0/DevFast.Net.Extensions.Etc.PipeLine.md +++ b/docs/netstandard2.0/DevFast.Net.Extensions.Etc.PipeLine.md @@ -17,14 +17,14 @@ public static class PipeLine - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,ValueTask<T>>, Func<T,TTanState,Task<T>>, Func<TTanState,TSrcState>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.Task_T__,System.Func_TTanState,TSrcState_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, System.Func, bool)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,ValueTask<T>>, Func<T,TTanState,Task>, Func<TTanState,TSrcState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.Task_,System.Func_TTanState,TSrcState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,ValueTask<T>>, Func<T,TTanState,ValueTask<T>>, Func<TTanState,TSrcState>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_T__,System.Func_TTanState,TSrcState_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, System.Func, bool)')** + - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,ValueTask<T>>, Func<T,TTanState,ValueTask>, Func<TTanState,TSrcState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,ValueTask<T>>, Func<T,TTanState,T>, Func<TTanState,TSrcState>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool)')** - - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,ValueTask<T>>, Func<T,TTanState,ValueTask>, Func<TTanState,TSrcState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,T>, Action<T,TTanState>, Func<TTanState,TSrcState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Action_T,TTanState_,System.Func_TTanState,TSrcState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Action, System.Func)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,T>, Func<T,TTanState,Task<T>>, Func<TTanState,TSrcState>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.Task_T__,System.Func_TTanState,TSrcState_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, System.Func, bool)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,T>, Func<T,TTanState,Task>, Func<TTanState,TSrcState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.Task_,System.Func_TTanState,TSrcState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,T>, Func<T,TTanState,ValueTask<T>>, Func<TTanState,TSrcState>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_T__,System.Func_TTanState,TSrcState_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, System.Func, bool)')** + - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,T>, Func<T,TTanState,ValueTask>, Func<TTanState,TSrcState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func)')** - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,T>, Func<T,TTanState,T>, Func<TTanState,TSrcState>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool)')** - - **[Pipe<T,TSrcState,TTanState>(this Func<TSrcState,T>, Func<T,TTanState,ValueTask>, Func<TTanState,TSrcState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func)')** - **[Pipe<T,TState>(this Func<Task<T>>, Func<T,TState,Task<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_System.Threading.Tasks.Task_T__,System.Func_T,TState,System.Threading.Tasks.Task_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool)')** - **[Pipe<T,TState>(this Func<ValueTask<T>>, Func<T,TState,Task<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.Task_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool)')** - **[Pipe<T,TState>(this Func<ValueTask<T>>, Func<T,TState,ValueTask<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool)')** @@ -37,14 +37,14 @@ public static class PipeLine - **[Pipe<T,TState>(this Func<TState,ValueTask<T>>, Func<T,TState,Task<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.Task_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool)')** - **[Pipe<T,TState>(this Func<TState,ValueTask<T>>, Func<T,TState,Task>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.Task_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func)')** - **[Pipe<T,TState>(this Func<TState,ValueTask<T>>, Func<T,TState,ValueTask<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool)')** + - **[Pipe<T,TState>(this Func<TState,ValueTask<T>>, Func<T,TState,ValueTask>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func)')** - **[Pipe<T,TState>(this Func<TState,ValueTask<T>>, Func<T,TState,T>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,T_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, bool)')** - - **[Pipe<T,TState>(this Func<TState,ValueTask<T>>, Func<T,TState,ValueTask>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func)')** - **[Pipe<T,TState>(this Func<TState,T>, Action<T,TState>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Action_T,TState_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Action)')** - **[Pipe<T,TState>(this Func<TState,T>, Func<T,TState,Task<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.Task_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, bool)')** - **[Pipe<T,TState>(this Func<TState,T>, Func<T,TState,Task>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.Task_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func)')** - **[Pipe<T,TState>(this Func<TState,T>, Func<T,TState,ValueTask<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, bool)')** + - **[Pipe<T,TState>(this Func<TState,T>, Func<T,TState,ValueTask>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func)')** - **[Pipe<T,TState>(this Func<TState,T>, Func<T,TState,T>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,T_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, bool)')** - - **[Pipe<T,TState>(this Func<TState,T>, Func<T,TState,ValueTask>)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func)')** - **[Pipe<T,TState>(this Task<T>, Func<T,TState,Task<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Threading.Tasks.Task_T_,System.Func_T,TState,System.Threading.Tasks.Task_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Threading.Tasks.Task, System.Func>, bool)')** - **[Pipe<T,TState>(this T, Func<T,TState,T>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisT,System.Func_T,TState,T_,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this T, System.Func, bool)')** - **[Pipe<T>(this Func<Task<T>>, Func<T,Task<T>>, bool)](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T_(thisSystem.Func_System.Threading.Tasks.Task_T__,System.Func_T,System.Threading.Tasks.Task_T__,bool) 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool)')** @@ -321,7 +321,7 @@ Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevF to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Action_T,TTanState_,System.Func_TTanState,TSrcState_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Action, System.Func).tandemLambda'). ```csharp -public static System.Func Pipe(this System.Func> sourceLambda, System.Action tandemLambda, System.Func stateAdapter); +public static System.Func Pipe(this System.Func> sourceLambda, System.Action tandemLambda, System.Func stateAdapter); ``` #### Type parameters @@ -519,108 +519,108 @@ Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.Pip #### Returns [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_T__,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_T__,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - + -## PipeLine.Pipe(this Func>, Func, Func, bool) Method +## PipeLine.Pipe(this Func>, Func, Func) Method -Provides a conditional lambda, which upon execution: - -1. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).flag') is [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), feeds the output of -[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).sourceLambda') to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).tandemLambda') and returns the output obtained -from [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).tandemLambda'). -2. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).flag') is [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), returns the output of the original -[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).sourceLambda'). +Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).sourceLambda') +to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).tandemLambda'). ```csharp -public static System.Func> Pipe(this System.Func> sourceLambda, System.Func tandemLambda, System.Func stateAdapter, bool flag); +public static System.Func Pipe(this System.Func> sourceLambda, System.Func tandemLambda, System.Func stateAdapter); ``` #### Type parameters - + `T` - + `TSrcState` - + `TTanState` #### Parameters - + -`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Source lambda to which the tandem operation would be applied. - + -`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') +`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') -Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).sourceLambda'). +Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).sourceLambda'). - + -`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda for state manipulation. - - -`flag` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') - -Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).tandemLambda') should be applied or not - #### Returns -[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - + -## PipeLine.Pipe(this Func>, Func, Func) Method +## PipeLine.Pipe(this Func>, Func, Func, bool) Method -Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).sourceLambda') -to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).tandemLambda'). +Provides a conditional lambda, which upon execution: + +1. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).flag') is [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), feeds the output of +[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).sourceLambda') to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).tandemLambda') and returns the output obtained +from [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).tandemLambda'). +2. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).flag') is [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), returns the output of the original +[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).sourceLambda'). ```csharp -public static System.Func Pipe(this System.Func> sourceLambda, System.Func tandemLambda, System.Func stateAdapter); +public static System.Func> Pipe(this System.Func> sourceLambda, System.Func tandemLambda, System.Func stateAdapter, bool flag); ``` #### Type parameters - + `T` - + `TSrcState` - + `TTanState` #### Parameters - + -`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Source lambda to which the tandem operation would be applied. - + -`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') +`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') -Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).sourceLambda'). +Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).sourceLambda'). - + -`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda for state manipulation. + + +`flag` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).tandemLambda') should be applied or not + #### Returns -[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') @@ -828,108 +828,108 @@ Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.Pip #### Returns [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_T__,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_T__,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - - -## PipeLine.Pipe(this Func, Func, Func, bool) Method + -Provides a conditional lambda, which upon execution: +## PipeLine.Pipe(this Func, Func, Func) Method -1. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).flag') is [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), feeds the output of -[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).sourceLambda') to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).tandemLambda') and returns the output obtained -from [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).tandemLambda'). -2. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).flag') is [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), returns the output of the original -[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).sourceLambda'). +Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).sourceLambda') +to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).tandemLambda'). ```csharp -public static System.Func Pipe(this System.Func sourceLambda, System.Func tandemLambda, System.Func stateAdapter, bool flag); +public static System.Func Pipe(this System.Func sourceLambda, System.Func tandemLambda, System.Func stateAdapter); ``` #### Type parameters - + `T` - + `TSrcState` - + `TTanState` #### Parameters - + -`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Source lambda to which the tandem operation would be applied. - + -`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') +`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') -Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).sourceLambda'). +Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).sourceLambda'). - + -`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda for state manipulation. - - -`flag` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') - -Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).tandemLambda') should be applied or not - #### Returns -[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,System.Threading.Tasks.ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - + -## PipeLine.Pipe(this Func, Func, Func) Method +## PipeLine.Pipe(this Func, Func, Func, bool) Method + +Provides a conditional lambda, which upon execution: -Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).sourceLambda') -to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).tandemLambda'). +1. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).flag') is [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), feeds the output of +[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).sourceLambda') to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).tandemLambda') and returns the output obtained +from [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).tandemLambda'). +2. If [flag](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).flag 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).flag') is [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'), returns the output of the original +[sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).sourceLambda'). ```csharp -public static System.Func Pipe(this System.Func sourceLambda, System.Func tandemLambda, System.Func stateAdapter); +public static System.Func Pipe(this System.Func sourceLambda, System.Func tandemLambda, System.Func stateAdapter, bool flag); ``` #### Type parameters - + `T` - + `TSrcState` - + `TTanState` #### Parameters - + -`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TSrcState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Source lambda to which the tandem operation would be applied. - + -`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') +`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') -Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).sourceLambda'). +Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).sourceLambda'). - + -`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +`stateAdapter` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSrcState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TSrcState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TSrcState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') Lambda for state manipulation. + + +`flag` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).tandemLambda') should be applied or not + #### Returns -[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,ValueTask_,System.Func_TTanState,TSrcState_).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') +[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TTanState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).TTanState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).TTanState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TSrcState,TTanState_(thisSystem.Func_TSrcState,T_,System.Func_T,TTanState,T_,System.Func_TTanState,TSrcState_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') @@ -1293,7 +1293,7 @@ Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevF to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Action_T,TState_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Action).tandemLambda'). ```csharp -public static System.Func Pipe(this System.Func> sourceLambda, System.Action tandemLambda); +public static System.Func Pipe(this System.Func> sourceLambda, System.Action tandemLambda); ``` #### Type parameters @@ -1451,6 +1451,42 @@ Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.Pip #### Returns [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_T__,bool).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_T__,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func>, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') + + +## PipeLine.Pipe(this Func>, Func) Method + +Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).sourceLambda') +to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).tandemLambda'). + +```csharp +public static System.Func Pipe(this System.Func> sourceLambda, System.Func tandemLambda); +``` +#### Type parameters + + + +`T` + + + +`TState` +#### Parameters + + + +`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') + +Source lambda to which the tandem operation would be applied. + + + +`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') + +Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).sourceLambda'). + +#### Returns +[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,System.Threading.Tasks.ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') + ## PipeLine.Pipe(this Func>, Func, bool) Method @@ -1498,42 +1534,6 @@ Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.Pip #### Returns [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,T_,bool).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, bool).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,T_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - - -## PipeLine.Pipe(this Func>, Func) Method - -Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).sourceLambda') -to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).tandemLambda'). - -```csharp -public static System.Func Pipe(this System.Func> sourceLambda, System.Func tandemLambda); -``` -#### Type parameters - - - -`T` - - - -`TState` -#### Parameters - - - -`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - -Source lambda to which the tandem operation would be applied. - - - -`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') - -Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).sourceLambda'). - -#### Returns -[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,System.Threading.Tasks.ValueTask_T__,System.Func_T,TState,ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func>, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - ## PipeLine.Pipe(this Func, Action) Method @@ -1700,6 +1700,42 @@ Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.Pip #### Returns [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_T__,bool).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, bool).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_T__,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func>, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') + + +## PipeLine.Pipe(this Func, Func) Method + +Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).sourceLambda') +to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).tandemLambda'). + +```csharp +public static System.Func Pipe(this System.Func sourceLambda, System.Func tandemLambda); +``` +#### Type parameters + + + +`T` + + + +`TState` +#### Parameters + + + +`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') + +Source lambda to which the tandem operation would be applied. + + + +`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') + +Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).sourceLambda'). + +#### Returns +[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,System.Threading.Tasks.ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') + ## PipeLine.Pipe(this Func, Func, bool) Method @@ -1747,42 +1783,6 @@ Conditional flag dictating whether [tandemLambda](DevFast.Net.Extensions.Etc.Pip #### Returns [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,T_,bool).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, bool).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,T_,bool).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - - -## PipeLine.Pipe(this Func, Func) Method - -Provides a lambda, which upon execution, feeds the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).sourceLambda') -to the [tandemLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).tandemLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).tandemLambda'). - -```csharp -public static System.Func Pipe(this System.Func sourceLambda, System.Func tandemLambda); -``` -#### Type parameters - - - -`T` - - - -`TState` -#### Parameters - - - -`sourceLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - -Source lambda to which the tandem operation would be applied. - - - -`tandemLambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).T 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') - -Tandem lambda that would consume the output of [sourceLambda](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).sourceLambda 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).sourceLambda'). - -#### Returns -[System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TState](DevFast.Net.Extensions.Etc.PipeLine.md#DevFast.Net.Extensions.Etc.PipeLine.Pipe_T,TState_(thisSystem.Func_TState,T_,System.Func_T,TState,ValueTask_).TState 'DevFast.Net.Extensions.Etc.PipeLine.Pipe(this System.Func, System.Func).TState')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - ## PipeLine.Pipe(this Task, Func>, bool) Method diff --git a/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md new file mode 100644 index 0000000..775275d --- /dev/null +++ b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -0,0 +1,67 @@ +#### [DevFast.Net.Extensions](index.md 'index') +### [DevFast.Net.Extensions.SystemTypes](DevFast.Net.Extensions.SystemTypes.md 'DevFast.Net.Extensions.SystemTypes') + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` +- *Methods* + - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections +### Methods + + + +## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method + +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). + +```csharp +public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +``` +#### Type parameters + + + +`T` +#### Parameters + + + +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') + +Collection on which chunks will be created. + + + +`maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +Maximum size of a given chunk + + + +`token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Cancellation token to observe. + + + +`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.Enumerables.md b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.Enumerables.md index f5ef6fb..2321c3b 100644 --- a/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.Enumerables.md +++ b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.Enumerables.md @@ -12,8 +12,8 @@ public static class Enumerables - **[CountAsync<T>(this IAsyncEnumerable<T>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.CountAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.CountAsync(this System.Collections.Generic.IAsyncEnumerable, System.Threading.CancellationToken, bool)')** - **[CountLongAsync<T>(this IAsyncEnumerable<T>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.CountLongAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.CountLongAsync(this System.Collections.Generic.IAsyncEnumerable, System.Threading.CancellationToken, bool)')** - **[ForEach<T>(this IEnumerable<T>, Action<T,CancellationToken>, CancellationToken)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEach_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Action_T,System.Threading.CancellationToken_,System.Threading.CancellationToken) 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEach(this System.Collections.Generic.IEnumerable, System.Action, System.Threading.CancellationToken)')** - - **[ForEachAsync<T>(this IAsyncEnumerable<T>, Func<T,CancellationToken,ValueTask>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool)')** - - **[ForEachAsync<T>(this IEnumerable<T>, Func<T,CancellationToken,ValueTask>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool)')** + - **[ForEachAsync<T>(this IAsyncEnumerable<T>, Func<T,CancellationToken,ValueTask>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool)')** + - **[ForEachAsync<T>(this IEnumerable<T>, Func<T,CancellationToken,ValueTask>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool)')** - **[SelectAsync<TIn,TOut>(this IAsyncEnumerable<TIn>, Func<TIn,CancellationToken,ValueTask<TOut>>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.SelectAsync_TIn,TOut_(thisSystem.Collections.Generic.IAsyncEnumerable_TIn_,System.Func_TIn,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_TOut__,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.SelectAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func>, System.Threading.CancellationToken, bool)')** - **[SelectAsync<TIn,TOut>(this IAsyncEnumerable<TIn>, Func<TIn,CancellationToken,TOut>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.SelectAsync_TIn,TOut_(thisSystem.Collections.Generic.IAsyncEnumerable_TIn_,System.Func_TIn,System.Threading.CancellationToken,TOut_,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.SelectAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool)')** - **[SelectAsync<TIn,TOut>(this IEnumerable<TIn>, Func<TIn,CancellationToken,ValueTask<TOut>>, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.SelectAsync_TIn,TOut_(thisSystem.Collections.Generic.IEnumerable_TIn_,System.Func_TIn,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_TOut__,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.Enumerables.SelectAsync(this System.Collections.Generic.IEnumerable, System.Func>, System.Threading.CancellationToken, bool)')** @@ -148,41 +148,41 @@ predicate to apply Cancellation token to pass on to the supplied [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEach_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Action_T,System.Threading.CancellationToken_,System.Threading.CancellationToken).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEach(this System.Collections.Generic.IEnumerable, System.Action, System.Threading.CancellationToken).lambda') - + ## Enumerables.ForEachAsync(this IAsyncEnumerable, Func, CancellationToken, bool) Method -Calls [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') for every item in [asyncCollection](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).asyncCollection 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).asyncCollection') with given [token](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).token'), asynchronously. +Calls [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') for every item in [asyncCollection](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).asyncCollection 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).asyncCollection') with given [token](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).token'), asynchronously. ```csharp -public static System.Threading.Tasks.Task ForEachAsync(this System.Collections.Generic.IAsyncEnumerable asyncCollection, System.Func lambda, System.Threading.CancellationToken token=default(System.Threading.CancellationToken), bool continueOnCapturedContext=false); +public static System.Threading.Tasks.Task ForEachAsync(this System.Collections.Generic.IAsyncEnumerable asyncCollection, System.Func lambda, System.Threading.CancellationToken token=default(System.Threading.CancellationToken), bool continueOnCapturedContext=false); ``` #### Type parameters - + `T` #### Parameters - + -`asyncCollection` [System.Collections.Generic.IAsyncEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1') +`asyncCollection` [System.Collections.Generic.IAsyncEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1') Asynchronously Enumerable items - + -`lambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') +`lambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') Lambda to apply - + `token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') -Cancellation token to pass on to the supplied [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') and enumerator of [asyncCollection](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).asyncCollection 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).asyncCollection') +Cancellation token to pass on to the supplied [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') and enumerator of [asyncCollection](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IAsyncEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).asyncCollection 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IAsyncEnumerable, System.Func, System.Threading.CancellationToken, bool).asyncCollection') - + `continueOnCapturedContext` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') @@ -191,41 +191,41 @@ Cancellation token to pass on to the supplied [lambda](DevFast.Net.Extensions.Sy #### Returns [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') - + ## Enumerables.ForEachAsync(this IEnumerable, Func, CancellationToken, bool) Method -Calls [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') for every item in [collection](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).collection 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).collection') with given [token](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).token'), asynchronously. +Calls [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') for every item in [collection](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).collection 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).collection') with given [token](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).token'), asynchronously. ```csharp -public static System.Threading.Tasks.Task ForEachAsync(this System.Collections.Generic.IEnumerable collection, System.Func lambda, System.Threading.CancellationToken token=default(System.Threading.CancellationToken), bool continueOnCapturedContext=false); +public static System.Threading.Tasks.Task ForEachAsync(this System.Collections.Generic.IEnumerable collection, System.Func lambda, System.Threading.CancellationToken token=default(System.Threading.CancellationToken), bool continueOnCapturedContext=false); ``` #### Type parameters - + `T` #### Parameters - + -`collection` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') +`collection` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') Enumerable items - + -`lambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') +`lambda` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[T](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).T')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3')[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-3 'System.Func`3') Lambda to apply - + `token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') -Cancellation token to pass on to the supplied [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') +Cancellation token to pass on to the supplied [lambda](DevFast.Net.Extensions.SystemTypes.Enumerables.md#DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync_T_(thisSystem.Collections.Generic.IEnumerable_T_,System.Func_T,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask_,System.Threading.CancellationToken,bool).lambda 'DevFast.Net.Extensions.SystemTypes.Enumerables.ForEachAsync(this System.Collections.Generic.IEnumerable, System.Func, System.Threading.CancellationToken, bool).lambda') - + `continueOnCapturedContext` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') diff --git a/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.md b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.md index ae5ee25..70af908 100644 --- a/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.md +++ b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.md @@ -7,5 +7,6 @@ Under this [namespace](https://docs.microsoft.com/en-us/dotnet/csharp/language-r | Classes | | | :--- | :--- | | [ByteArrays](DevFast.Net.Extensions.SystemTypes.ByteArrays.md 'DevFast.Net.Extensions.SystemTypes.ByteArrays') | Extension methods on Array of type [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte'). | +| [DataCollections](DevFast.Net.Extensions.SystemTypes.DataCollections.md 'DevFast.Net.Extensions.SystemTypes.DataCollections') | Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). | | [Enumerables](DevFast.Net.Extensions.SystemTypes.Enumerables.md 'DevFast.Net.Extensions.SystemTypes.Enumerables') | Extension methods on [System.Collections.Generic.IEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') and [System.Collections.Generic.IAsyncEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1'). | | [Strings](DevFast.Net.Extensions.SystemTypes.Strings.md 'DevFast.Net.Extensions.SystemTypes.Strings') | Extension methods on [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String'). | diff --git a/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md new file mode 100644 index 0000000..775275d --- /dev/null +++ b/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -0,0 +1,67 @@ +#### [DevFast.Net.Extensions](index.md 'index') +### [DevFast.Net.Extensions.SystemTypes](DevFast.Net.Extensions.SystemTypes.md 'DevFast.Net.Extensions.SystemTypes') + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` +- *Methods* + - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + +## DataCollections Class + +Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). + +```csharp +public static class DataCollections +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections +### Methods + + + +## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method + +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). + +```csharp +public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +``` +#### Type parameters + + + +`T` +#### Parameters + + + +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') + +Collection on which chunks will be created. + + + +`maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +Maximum size of a given chunk + + + +`token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Cancellation token to observe. + + + +`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.md b/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.md index 314805e..6fa7744 100644 --- a/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.md +++ b/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.md @@ -7,6 +7,7 @@ Under this [namespace](https://docs.microsoft.com/en-us/dotnet/csharp/language-r | Classes | | | :--- | :--- | | [ByteArrays](DevFast.Net.Extensions.SystemTypes.ByteArrays.md 'DevFast.Net.Extensions.SystemTypes.ByteArrays') | Extension methods on Array of type [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte'). | +| [DataCollections](DevFast.Net.Extensions.SystemTypes.DataCollections.md 'DevFast.Net.Extensions.SystemTypes.DataCollections') | Extension methods on various data-collection e.g. [System.Collections.Generic.IList<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1'). | | [Enumerables](DevFast.Net.Extensions.SystemTypes.Enumerables.md 'DevFast.Net.Extensions.SystemTypes.Enumerables') | Extension methods on [System.Collections.Generic.IEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') and [System.Collections.Generic.IAsyncEnumerable<>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IAsyncEnumerable-1 'System.Collections.Generic.IAsyncEnumerable`1'). | | [ReadableSpan](DevFast.Net.Extensions.SystemTypes.ReadableSpan.md 'DevFast.Net.Extensions.SystemTypes.ReadableSpan') | Extension methods on [System.ReadOnlySpan<>](https://docs.microsoft.com/en-us/dotnet/api/System.ReadOnlySpan-1 'System.ReadOnlySpan`1'). | | [Strings](DevFast.Net.Extensions.SystemTypes.Strings.md 'DevFast.Net.Extensions.SystemTypes.Strings') | Extension methods on [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String'). | diff --git a/src/DevFast.Net.Extensions.Tests/DevFast.Net.Extensions.Tests.csproj b/src/DevFast.Net.Extensions.Tests/DevFast.Net.Extensions.Tests.csproj index 785d54a..89bbb6d 100644 --- a/src/DevFast.Net.Extensions.Tests/DevFast.Net.Extensions.Tests.csproj +++ b/src/DevFast.Net.Extensions.Tests/DevFast.Net.Extensions.Tests.csproj @@ -10,10 +10,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/DevFast.Net.Extensions.Tests/GlobalUsings.cs b/src/DevFast.Net.Extensions.Tests/GlobalUsings.cs index 61ad13f..e87ce78 100644 --- a/src/DevFast.Net.Extensions.Tests/GlobalUsings.cs +++ b/src/DevFast.Net.Extensions.Tests/GlobalUsings.cs @@ -3,7 +3,7 @@ global using NUnit.Framework; global using static NUnit.Framework.Assert; global using Ae = System.ArgumentException; -global using Ioe = System.InvalidOperationException; +global using Cts = System.Threading.CancellationTokenSource; global using Edi = System.Runtime.ExceptionServices.ExceptionDispatchInfo; +global using Ioe = System.InvalidOperationException; global using Token = System.Threading.CancellationToken; -global using Cts = System.Threading.CancellationTokenSource; diff --git a/src/DevFast.Net.Extensions.Tests/SystemTypes/ByteArraysTests.cs b/src/DevFast.Net.Extensions.Tests/SystemTypes/ByteArraysTests.cs index da7a173..24ed9fd 100644 --- a/src/DevFast.Net.Extensions.Tests/SystemTypes/ByteArraysTests.cs +++ b/src/DevFast.Net.Extensions.Tests/SystemTypes/ByteArraysTests.cs @@ -50,7 +50,7 @@ public void DoubleByteCapacity_Works_As_Expected(int initial, int expected) var a = Enumerable.Range(0, initial).Select(x => (byte)x).ToArray(); var b = a.DoubleByteCapacity(); That(b, Has.Length.EqualTo(expected)); - Enumerable.Range(0, initial).ForEach((x, _) => That(a[x], Is.EqualTo(b[x])), CancellationToken.None); + Enumerable.Range(0, initial).ForEach((x, _) => That(a[x], Is.EqualTo(b[x])), Token.None); } [TestCase(0, 0, 0)] @@ -62,7 +62,7 @@ public void EnsureByteCapacity_Works_As_Expected(int initial, int target, int ex var a = Enumerable.Range(0, initial).Select(x => (byte)x).ToArray(); var b = a.EnsureByteCapacity(target); That(b, Has.Length.EqualTo(expected)); - Enumerable.Range(0, initial).ForEach((x, _) => That(a[x], Is.EqualTo(b[x])), CancellationToken.None); + Enumerable.Range(0, initial).ForEach((x, _) => That(a[x], Is.EqualTo(b[x])), Token.None); } [Test] diff --git a/src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs b/src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs new file mode 100644 index 0000000..99c949b --- /dev/null +++ b/src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs @@ -0,0 +1,131 @@ +namespace DevFast.Net.Extensions.Tests.SystemTypes +{ + [TestFixture] + public class DataCollectionsTests + { + [Test] + public void IList_ToChunks_WorksWell_On_Empty_List() + { + List l = new(0); + That(l.ToChunks(1, Token.None).Count(), Is.EqualTo(0)); + } + + [Test] + public void IList_ToChunks_WorksWell_On_Shorter_List_Compared_To_Chunk_Size() + { + List l = new(1) { 1 }; + That(l.ToChunks(1, Token.None).Count(), Is.EqualTo(1)); + That(l.ToChunks(1, Token.None).First().Count(), Is.EqualTo(1)); + l = Enumerable.Range(0, 10).ToList(); + That(l.ToChunks(10, Token.None).Count(), Is.EqualTo(1)); + That(l.ToChunks(10, Token.None).First().Count(), Is.EqualTo(10)); + l = Enumerable.Range(0, 10).ToList(); + That(l.ToChunks(20, Token.None).Count(), Is.EqualTo(1)); + That(l.ToChunks(20, Token.None).First().Count(), Is.EqualTo(10)); + } + + [Test] + public void IList_ToChunks_WorksWell_On_Larger_List_Compared_To_Chunk_Size() + { + List l = Enumerable.Range(0, 10).ToList(); + That(l.ToChunks(1, Token.None).Count(), Is.EqualTo(10)); + l.ToChunks(1, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(1))); + That(l.ToChunks(2, Token.None).Count(), Is.EqualTo(5)); + l.ToChunks(2, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(2))); + That(l.ToChunks(5, Token.None).Count(), Is.EqualTo(2)); + l.ToChunks(5, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(5))); + That(l.ToChunks(3, Token.None).Count(), Is.EqualTo(4)); + l.ToChunks(3, Token.None).ForEach((x, _) => That(x.Count().Equals(3) || x.Count().Equals(1), Is.True)); + That(l.ToChunks(7, Token.None).Count(), Is.EqualTo(2)); + l.ToChunks(7, Token.None).ForEach((x, _) => That(x.Count().Equals(7) || x.Count().Equals(3), Is.True)); + That(l.ToChunks(9, Token.None).Count(), Is.EqualTo(2)); + l.ToChunks(9, Token.None).ForEach((x, _) => That(x.Count().Equals(9) || x.Count().Equals(1), Is.True)); + } + + [Test] + public void IList_ToChunks_Works_With_Reset() + { + using Cts cts = new(); + IEnumerable l = Enumerable.Range(0, 10).ToList().ToChunks(3, cts.Token).Skip(1).First(); + int start = 3; + using IEnumerator le = l.GetEnumerator(); + while (le.MoveNext()) + { + That(le.Current, Is.EqualTo(start++)); + } + le.Reset(); + That(start, Is.EqualTo(6)); + start = 3; + while (le.MoveNext()) + { + That(le.Current, Is.EqualTo(start++)); + } + That(start, Is.EqualTo(6)); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void IList_ToChunks_Correctly_Uses_CancellationToken_During_Chunk_Enumeration(bool useTokenInChunkEnumeration) + { + using Cts cts = new(); + System.Collections.IEnumerable l = Enumerable.Range(0, 10).ToList().ToChunks(3, cts.Token, useTokenInChunkEnumeration).Skip(1).First(); + System.Collections.IEnumerator le = l.GetEnumerator(); + int start = 3; + if (useTokenInChunkEnumeration) + { + OperationCanceledException? e = Throws(() => + { + while (le.MoveNext()) + { + That(le.Current, Is.EqualTo(start++)); + cts.Cancel(); + } + }); + That(start, Is.EqualTo(4)); + That(e, Is.Not.Null); + } + else + { + while (le.MoveNext()) + { + That(le.Current, Is.EqualTo(start++)); + cts.Cancel(); + } + That(start, Is.EqualTo(6)); + } + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void IList_ToChunks_Correctly_Uses_CancellationToken_During_Chunk_Creation(bool useTokenInChunkEnumeration) + { + using Cts cts = new(); + IEnumerable> l = Enumerable.Range(0, 10).ToList().ToChunks(3, cts.Token, useTokenInChunkEnumeration); + using IEnumerator> le = l.GetEnumerator(); + int start = 0; + OperationCanceledException? e = Throws(() => + { + while (le.MoveNext()) + { + IEnumerable chunk = le.Current; + using IEnumerator chunkEnum = chunk.GetEnumerator(); + while (chunkEnum.MoveNext()) + { + That(chunkEnum.Current, Is.EqualTo(start++)); + } + start = 0; + chunkEnum.Reset(); + while (chunkEnum.MoveNext()) + { + That(chunkEnum.Current, Is.EqualTo(start++)); + } + cts.Cancel(); + } + }); + That(e, Is.Not.Null); + That(start, Is.EqualTo(3)); + } + } +} diff --git a/src/DevFast.Net.Extensions/GlobalUsings.cs b/src/DevFast.Net.Extensions/GlobalUsings.cs index 6f1b93e..bb5d624 100644 --- a/src/DevFast.Net.Extensions/GlobalUsings.cs +++ b/src/DevFast.Net.Extensions/GlobalUsings.cs @@ -1,3 +1,4 @@ global using Ae = System.ArgumentException; -global using Ioe = System.InvalidOperationException; global using Edi = System.Runtime.ExceptionServices.ExceptionDispatchInfo; +global using Ioe = System.InvalidOperationException; +global using Token = System.Threading.CancellationToken; diff --git a/src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs b/src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs new file mode 100644 index 0000000..0e057ef --- /dev/null +++ b/src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs @@ -0,0 +1,164 @@ +using DevFast.Net.Extensions.Etc; + +namespace DevFast.Net.Extensions.SystemTypes; + +/// +/// Extension methods on various data-collection e.g. . +/// +public static class DataCollections +{ + /// + /// Splits the elements of given into chunks of + /// WITHOUT re-allocating the memory while observing the provided . + /// + /// Collection on which chunks will be created. + /// Maximum size of a given chunk + /// Cancellation token to observe. + /// When token cancellation is observed during chunk enumeration (may slow-down enumeration) + public static IEnumerable> ToChunks(this IList list, + int maxSize, + Token token, + bool observeTokenInChunkEnumeration = false) + { + if (list.Count.Equals(0)) + { + yield break; + } + + if (list.Count <= maxSize.ThrowArgumentExceptionOnPredicateFail(static x => x >= 1, nameof(maxSize), $"{nameof(maxSize)} >= 1")) + { + yield return list; + yield break; + } + + int i = 0; + while (i < list.Count) + { + token.ThrowIfCancellationRequested(); + yield return new ListChunkEnumerable(list, i, maxSize, observeTokenInChunkEnumeration ? token : Token.None); + i += maxSize; + } + } + + private sealed class ListChunkEnumerable(IList list, int start, int maxSize, Token token) : IEnumerable + { + public IEnumerator GetEnumerator() + { + return token.CanBeCanceled + ? new CancellableListChunkEnumerator( + list, + start.ThrowArgumentExceptionOnPredicateFail( + x => x < list.Count, + nameof(start), + $"{nameof(start)} < {nameof(list)}.{nameof(list.Count)}" + ), + Math.Min(list.Count, start + maxSize), + token + ) : new ListChunkEnumerator( + list, + start.ThrowArgumentExceptionOnPredicateFail( + x => x < list.Count, + nameof(start), + $"{nameof(start)} < {nameof(list)}.{nameof(list.Count)}" + ), + Math.Min(list.Count, start + maxSize) + ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + private sealed class CancellableListChunkEnumerator : IEnumerator + { + private int _idx; + private readonly int _beginIncl; + private readonly int _endExcl; + private readonly Token _token; + private IList? _list; + +#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. + public CancellableListChunkEnumerator(IList list, int beginIncl, int endExcl, Token token) +#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. + { + _list = list; + _idx = beginIncl; + _beginIncl = beginIncl; + _endExcl = endExcl; + _token = token; + } + + public T Current { get; private set; } + +#pragma warning disable CS8603 // Possible null reference return. + object System.Collections.IEnumerator.Current => Current; +#pragma warning restore CS8603 // Possible null reference return. + + public void Dispose() + { + _list = null; + } + + public bool MoveNext() + { + _token.ThrowIfCancellationRequested(); + if (_idx < _endExcl) + { + Current = _list![_idx++]; + return true; + } + return false; + } + + public void Reset() + { + _idx = _beginIncl; + } + } + + private sealed class ListChunkEnumerator : IEnumerator + { + private int _idx; + private readonly int _beginIncl; + private readonly int _endExcl; + private IList? _list; + +#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. + public ListChunkEnumerator(IList list, int beginIncl, int endExcl) +#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. + { + _list = list; + _idx = beginIncl; + _beginIncl = beginIncl; + _endExcl = endExcl; + } + + public T Current { get; private set; } + +#pragma warning disable CS8603 // Possible null reference return. + object System.Collections.IEnumerator.Current => Current; +#pragma warning restore CS8603 // Possible null reference return. + + public void Dispose() + { + _list = null; + } + + public bool MoveNext() + { + if (_idx < _endExcl) + { + Current = _list![_idx++]; + return true; + } + return false; + } + + public void Reset() + { + _idx = _beginIncl; + } + } + } +} diff --git a/src/DevFast.Net.Extensions/SystemTypes/Enumerables.cs b/src/DevFast.Net.Extensions/SystemTypes/Enumerables.cs index 7e0b08a..4c061d8 100644 --- a/src/DevFast.Net.Extensions/SystemTypes/Enumerables.cs +++ b/src/DevFast.Net.Extensions/SystemTypes/Enumerables.cs @@ -13,8 +13,8 @@ public static class Enumerables /// Enumerable items /// predicate to apply /// Cancellation token to pass on to the supplied - public static void ForEach(this IEnumerable collection, Action lambda, - CancellationToken token = default) + public static void ForEach(this IEnumerable collection, Action lambda, + Token token = default) { foreach (T item in collection) { @@ -30,8 +30,8 @@ public static void ForEach(this IEnumerable collection, ActionCancellation token to pass on to the supplied /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async Task ForEachAsync(this IEnumerable collection, - Func lambda, - CancellationToken token = default, + Func lambda, + Token token = default, bool continueOnCapturedContext = false) { foreach (T item in collection) @@ -48,8 +48,8 @@ public static async Task ForEachAsync(this IEnumerable collection, /// Cancellation token to pass on to the supplied and enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async Task ForEachAsync(this IAsyncEnumerable asyncCollection, - Func lambda, - CancellationToken token = default, + Func lambda, + Token token = default, bool continueOnCapturedContext = false) { await foreach (T item in asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext)) @@ -69,8 +69,8 @@ public static async Task ForEachAsync(this IAsyncEnumerable asyncCollectio /// Cancellation token to pass on to the supplied /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable SelectAsync(this IEnumerable collection, - Func> lambda, - [EnumeratorCancellation] CancellationToken token = default, + Func> lambda, + [EnumeratorCancellation] Token token = default, bool continueOnCapturedContext = false) { using IEnumerator enu = collection.GetEnumerator(); @@ -91,8 +91,8 @@ public static async IAsyncEnumerable SelectAsync(this IEnumerab /// Cancellation token to pass on to the supplied and enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable SelectAsync(this IAsyncEnumerable asyncCollection, - Func lambda, - [EnumeratorCancellation] CancellationToken token = default, + Func lambda, + [EnumeratorCancellation] Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -120,8 +120,8 @@ public static async IAsyncEnumerable SelectAsync(this IAsyncEnu /// Cancellation token to pass on to the supplied and enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable SelectAsync(this IAsyncEnumerable asyncCollection, - Func> lambda, - [EnumeratorCancellation] CancellationToken token = default, + Func> lambda, + [EnumeratorCancellation] Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -150,7 +150,7 @@ public static async IAsyncEnumerable SelectAsync(this IAsyncEnu /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable SkipAsync(this IAsyncEnumerable asyncCollection, int count, - [EnumeratorCancellation] CancellationToken token = default, + [EnumeratorCancellation] Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -185,7 +185,7 @@ public static async IAsyncEnumerable SkipAsync(this IAsyncEnumerable to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable TakeAsync(this IAsyncEnumerable asyncCollection, int count, - [EnumeratorCancellation] CancellationToken token = default, + [EnumeratorCancellation] Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -213,8 +213,8 @@ public static async IAsyncEnumerable TakeAsync(this IAsyncEnumerableCancellation token to pass on to the supplied and enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable WhereAsync(this IAsyncEnumerable asyncCollection, - Func predicate, - [EnumeratorCancellation] CancellationToken token = default, + Func predicate, + [EnumeratorCancellation] Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -244,8 +244,8 @@ public static async IAsyncEnumerable WhereAsync(this IAsyncEnumerable a /// Cancellation token to pass on to the supplied and enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable WhereAsync(this IAsyncEnumerable asyncCollection, - Func> predicate, - [EnumeratorCancellation] CancellationToken token = default, + Func> predicate, + [EnumeratorCancellation] Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -273,7 +273,7 @@ public static async IAsyncEnumerable WhereAsync(this IAsyncEnumerable a /// Cancellation token to pass to enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async ValueTask CountAsync(this IAsyncEnumerable asyncCollection, - CancellationToken token = default, + Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -301,7 +301,7 @@ public static async ValueTask CountAsync(this IAsyncEnumerable asyncC /// Cancellation token to pass to enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async ValueTask CountLongAsync(this IAsyncEnumerable asyncCollection, - CancellationToken token = default, + Token token = default, bool continueOnCapturedContext = false) { ConfiguredCancelableAsyncEnumerable.Enumerator ae = asyncCollection.WithCancellation(token).ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator(); @@ -329,7 +329,7 @@ public static async ValueTask CountLongAsync(this IAsyncEnumerable /// Cancellation token to pass to enumerator of /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async ValueTask> ToListAsync(this IAsyncEnumerable asyncCollection, - CancellationToken token = default, + Token token = default, bool continueOnCapturedContext = false) { List l = []; @@ -356,7 +356,7 @@ public static async ValueTask> ToListAsync(this IAsyncEnumerable a /// Asynchronously Enumerable items /// Cancellation token to pass to enumerator of public static IEnumerable ToBlockingEnumerable(this IAsyncEnumerable asyncCollection, - CancellationToken token = default) + Token token = default) { IAsyncEnumerator ae = asyncCollection.GetAsyncEnumerator(token); try @@ -365,7 +365,7 @@ public static IEnumerable ToBlockingEnumerable(this IAsyncEnumerable as //using status check and onCompletion method using waithandles. //NET6 is soon going out of support, so would probably //drop the framework from the library. - while (ae.MoveNextAsync().AsTask().GetAwaiter().GetResult()) + while (ae!.MoveNextAsync().AsTask().GetAwaiter().GetResult()) { yield return ae.Current; } @@ -381,7 +381,7 @@ public static IEnumerable ToBlockingEnumerable(this IAsyncEnumerable as /// Collects maximum possible (controlled by ) items in the provided , puts it /// in a list and returns such lists as a part of newly created asynchronous enumerable. /// - /// USE-CASE: When the cost of calling is too huge (requires too much memory or items + /// USE-CASE: When the cost of calling is too huge (requires too much memory or items /// are too many to fit in a single ); and working on a small set of such items (instead of consuming single item at a time) /// is advantageous (for e.g. database batch inserts using medium sized asyncCollection, instead of inserting item at a time). /// @@ -404,7 +404,7 @@ public static IEnumerable ToBlockingEnumerable(this IAsyncEnumerable as /// to attempt to marshal the continuation back to the original context captured; otherwise, . public static async IAsyncEnumerable> ToChunksAsync(this IAsyncEnumerable asyncCollection, int maxChunkSize, - [EnumeratorCancellation] CancellationToken token = default, + [EnumeratorCancellation] Token token = default, bool reUseList = false, bool continueOnCapturedContext = false) { From 235a5565b8764124d28bc351ed731e04ef740ff6 Mon Sep 17 00:00:00 2001 From: samaysar Date: Wed, 18 Dec 2024 21:56:37 +0100 Subject: [PATCH 2/5] adding ilist chunking without memory consumption, can release 0.7.3 --- ReleaseNotes.txt | 5 ++ ....Extensions.SystemTypes.DataCollections.md | 28 +++++----- ....Extensions.SystemTypes.DataCollections.md | 28 +++++----- ....Extensions.SystemTypes.DataCollections.md | 28 +++++----- ....Extensions.SystemTypes.DataCollections.md | 28 +++++----- .../SystemTypes/DataCollectionsTests.cs | 56 +++++++++---------- .../SystemTypes/DataCollections.cs | 2 +- 7 files changed, 90 insertions(+), 85 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 950cc6b..6a38faf 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,8 @@ +DevFast.Net.Extensions 0.7.3 + + 1. New feature - Added following new extension methods in DevFast.Net.Extensions.SystemTypes.DataCollections: + - Chunk(this IList, int, CancellationToken, bool) + DevFast.Net.Extensions 0.7.2 1. New feature - With polyfill, increasing library scope for older .Net versions. diff --git a/docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md index 775275d..059ea4e 100644 --- a/docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md +++ b/docs/net6.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -9,7 +9,7 @@ Extension methods on various data-collection e.g. [System.Collections.Generic.IL public static class DataCollections ``` - *Methods* - - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + - **[Chunk<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** ## DataCollections Class @@ -22,46 +22,46 @@ public static class DataCollections Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections ### Methods - + -## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method +## DataCollections.Chunk(this IList, int, CancellationToken, bool) Method -Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') -WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). ```csharp -public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +public static System.Collections.Generic.IEnumerable> Chunk(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool observeTokenInChunkEnumeration=false); ``` #### Type parameters - + `T` #### Parameters - + -`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') Collection on which chunks will be created. - + `maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') Maximum size of a given chunk - + `token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') Cancellation token to observe. - + -`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`observeTokenInChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) #### Returns -[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md index 775275d..059ea4e 100644 --- a/docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md +++ b/docs/net8.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -9,7 +9,7 @@ Extension methods on various data-collection e.g. [System.Collections.Generic.IL public static class DataCollections ``` - *Methods* - - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + - **[Chunk<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** ## DataCollections Class @@ -22,46 +22,46 @@ public static class DataCollections Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections ### Methods - + -## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method +## DataCollections.Chunk(this IList, int, CancellationToken, bool) Method -Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') -WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). ```csharp -public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +public static System.Collections.Generic.IEnumerable> Chunk(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool observeTokenInChunkEnumeration=false); ``` #### Type parameters - + `T` #### Parameters - + -`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') Collection on which chunks will be created. - + `maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') Maximum size of a given chunk - + `token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') Cancellation token to observe. - + -`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`observeTokenInChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) #### Returns -[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md index 775275d..059ea4e 100644 --- a/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md +++ b/docs/netstandard2.0/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -9,7 +9,7 @@ Extension methods on various data-collection e.g. [System.Collections.Generic.IL public static class DataCollections ``` - *Methods* - - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + - **[Chunk<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** ## DataCollections Class @@ -22,46 +22,46 @@ public static class DataCollections Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections ### Methods - + -## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method +## DataCollections.Chunk(this IList, int, CancellationToken, bool) Method -Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') -WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). ```csharp -public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +public static System.Collections.Generic.IEnumerable> Chunk(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool observeTokenInChunkEnumeration=false); ``` #### Type parameters - + `T` #### Parameters - + -`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') Collection on which chunks will be created. - + `maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') Maximum size of a given chunk - + `token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') Cancellation token to observe. - + -`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`observeTokenInChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) #### Returns -[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md b/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md index 775275d..059ea4e 100644 --- a/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md +++ b/docs/netstandard2.1/DevFast.Net.Extensions.SystemTypes.DataCollections.md @@ -9,7 +9,7 @@ Extension methods on various data-collection e.g. [System.Collections.Generic.IL public static class DataCollections ``` - *Methods* - - **[ToChunks<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** + - **[Chunk<T>(this IList<T>, int, CancellationToken, bool)](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool) 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool)')** ## DataCollections Class @@ -22,46 +22,46 @@ public static class DataCollections Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DataCollections ### Methods - + -## DataCollections.ToChunks(this IList, int, CancellationToken, bool) Method +## DataCollections.Chunk(this IList, int, CancellationToken, bool) Method -Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') -WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). +Splits the elements of given [list](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).list 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).list') into chunks of [maxSize](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).maxSize 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).maxSize') +WITHOUT re-allocating the memory while observing the provided [token](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).token 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).token'). ```csharp -public static System.Collections.Generic.IEnumerable> ToChunks(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool checkTokenCancellationDuringChunkEnumeration=false); +public static System.Collections.Generic.IEnumerable> Chunk(this System.Collections.Generic.IList list, int maxSize, System.Threading.CancellationToken token, bool observeTokenInChunkEnumeration=false); ``` #### Type parameters - + `T` #### Parameters - + -`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') +`list` [System.Collections.Generic.IList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IList-1 'System.Collections.Generic.IList`1') Collection on which chunks will be created. - + `maxSize` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') Maximum size of a given chunk - + `token` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') Cancellation token to observe. - + -`checkTokenCancellationDuringChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`observeTokenInChunkEnumeration` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') When [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') token cancellation is observed during chunk enumeration (may slow-down enumeration) #### Returns -[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.ToChunks(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[T](DevFast.Net.Extensions.SystemTypes.DataCollections.md#DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk_T_(thisSystem.Collections.Generic.IList_T_,int,System.Threading.CancellationToken,bool).T 'DevFast.Net.Extensions.SystemTypes.DataCollections.Chunk(this System.Collections.Generic.IList, int, System.Threading.CancellationToken, bool).T')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') \ No newline at end of file diff --git a/src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs b/src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs index 99c949b..a77d4ca 100644 --- a/src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs +++ b/src/DevFast.Net.Extensions.Tests/SystemTypes/DataCollectionsTests.cs @@ -4,49 +4,49 @@ public class DataCollectionsTests { [Test] - public void IList_ToChunks_WorksWell_On_Empty_List() + public void IList_Chunk_WorksWell_On_Empty_List() { List l = new(0); - That(l.ToChunks(1, Token.None).Count(), Is.EqualTo(0)); + That(l.Chunk(1, Token.None).Count(), Is.EqualTo(0)); } [Test] - public void IList_ToChunks_WorksWell_On_Shorter_List_Compared_To_Chunk_Size() + public void IList_Chunk_WorksWell_On_Shorter_List_Compared_To_Chunk_Size() { List l = new(1) { 1 }; - That(l.ToChunks(1, Token.None).Count(), Is.EqualTo(1)); - That(l.ToChunks(1, Token.None).First().Count(), Is.EqualTo(1)); + That(l.Chunk(1, Token.None).Count(), Is.EqualTo(1)); + That(l.Chunk(1, Token.None).First().Count(), Is.EqualTo(1)); l = Enumerable.Range(0, 10).ToList(); - That(l.ToChunks(10, Token.None).Count(), Is.EqualTo(1)); - That(l.ToChunks(10, Token.None).First().Count(), Is.EqualTo(10)); + That(l.Chunk(10, Token.None).Count(), Is.EqualTo(1)); + That(l.Chunk(10, Token.None).First().Count(), Is.EqualTo(10)); l = Enumerable.Range(0, 10).ToList(); - That(l.ToChunks(20, Token.None).Count(), Is.EqualTo(1)); - That(l.ToChunks(20, Token.None).First().Count(), Is.EqualTo(10)); + That(l.Chunk(20, Token.None).Count(), Is.EqualTo(1)); + That(l.Chunk(20, Token.None).First().Count(), Is.EqualTo(10)); } [Test] - public void IList_ToChunks_WorksWell_On_Larger_List_Compared_To_Chunk_Size() + public void IList_Chunk_WorksWell_On_Larger_List_Compared_To_Chunk_Size() { List l = Enumerable.Range(0, 10).ToList(); - That(l.ToChunks(1, Token.None).Count(), Is.EqualTo(10)); - l.ToChunks(1, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(1))); - That(l.ToChunks(2, Token.None).Count(), Is.EqualTo(5)); - l.ToChunks(2, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(2))); - That(l.ToChunks(5, Token.None).Count(), Is.EqualTo(2)); - l.ToChunks(5, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(5))); - That(l.ToChunks(3, Token.None).Count(), Is.EqualTo(4)); - l.ToChunks(3, Token.None).ForEach((x, _) => That(x.Count().Equals(3) || x.Count().Equals(1), Is.True)); - That(l.ToChunks(7, Token.None).Count(), Is.EqualTo(2)); - l.ToChunks(7, Token.None).ForEach((x, _) => That(x.Count().Equals(7) || x.Count().Equals(3), Is.True)); - That(l.ToChunks(9, Token.None).Count(), Is.EqualTo(2)); - l.ToChunks(9, Token.None).ForEach((x, _) => That(x.Count().Equals(9) || x.Count().Equals(1), Is.True)); + That(l.Chunk(1, Token.None).Count(), Is.EqualTo(10)); + l.Chunk(1, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(1))); + That(l.Chunk(2, Token.None).Count(), Is.EqualTo(5)); + l.Chunk(2, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(2))); + That(l.Chunk(5, Token.None).Count(), Is.EqualTo(2)); + l.Chunk(5, Token.None).ForEach((x, _) => That(x.Count(), Is.EqualTo(5))); + That(l.Chunk(3, Token.None).Count(), Is.EqualTo(4)); + l.Chunk(3, Token.None).ForEach((x, _) => That(x.Count().Equals(3) || x.Count().Equals(1), Is.True)); + That(l.Chunk(7, Token.None).Count(), Is.EqualTo(2)); + l.Chunk(7, Token.None).ForEach((x, _) => That(x.Count().Equals(7) || x.Count().Equals(3), Is.True)); + That(l.Chunk(9, Token.None).Count(), Is.EqualTo(2)); + l.Chunk(9, Token.None).ForEach((x, _) => That(x.Count().Equals(9) || x.Count().Equals(1), Is.True)); } [Test] - public void IList_ToChunks_Works_With_Reset() + public void IList_Chunk_Works_With_Reset() { using Cts cts = new(); - IEnumerable l = Enumerable.Range(0, 10).ToList().ToChunks(3, cts.Token).Skip(1).First(); + IEnumerable l = Enumerable.Range(0, 10).ToList().Chunk(3, cts.Token).Skip(1).First(); int start = 3; using IEnumerator le = l.GetEnumerator(); while (le.MoveNext()) @@ -66,10 +66,10 @@ public void IList_ToChunks_Works_With_Reset() [Test] [TestCase(true)] [TestCase(false)] - public void IList_ToChunks_Correctly_Uses_CancellationToken_During_Chunk_Enumeration(bool useTokenInChunkEnumeration) + public void IList_Chunk_Correctly_Uses_CancellationToken_During_Chunk_Enumeration(bool useTokenInChunkEnumeration) { using Cts cts = new(); - System.Collections.IEnumerable l = Enumerable.Range(0, 10).ToList().ToChunks(3, cts.Token, useTokenInChunkEnumeration).Skip(1).First(); + System.Collections.IEnumerable l = Enumerable.Range(0, 10).ToList().Chunk(3, cts.Token, useTokenInChunkEnumeration).Skip(1).First(); System.Collections.IEnumerator le = l.GetEnumerator(); int start = 3; if (useTokenInChunkEnumeration) @@ -99,10 +99,10 @@ public void IList_ToChunks_Correctly_Uses_CancellationToken_During_Chunk_Enumera [Test] [TestCase(true)] [TestCase(false)] - public void IList_ToChunks_Correctly_Uses_CancellationToken_During_Chunk_Creation(bool useTokenInChunkEnumeration) + public void IList_Chunk_Correctly_Uses_CancellationToken_During_Chunk_Creation(bool useTokenInChunkEnumeration) { using Cts cts = new(); - IEnumerable> l = Enumerable.Range(0, 10).ToList().ToChunks(3, cts.Token, useTokenInChunkEnumeration); + IEnumerable> l = Enumerable.Range(0, 10).ToList().Chunk(3, cts.Token, useTokenInChunkEnumeration); using IEnumerator> le = l.GetEnumerator(); int start = 0; OperationCanceledException? e = Throws(() => diff --git a/src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs b/src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs index 0e057ef..170dff8 100644 --- a/src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs +++ b/src/DevFast.Net.Extensions/SystemTypes/DataCollections.cs @@ -15,7 +15,7 @@ public static class DataCollections /// Maximum size of a given chunk /// Cancellation token to observe. /// When token cancellation is observed during chunk enumeration (may slow-down enumeration) - public static IEnumerable> ToChunks(this IList list, + public static IEnumerable> Chunk(this IList list, int maxSize, Token token, bool observeTokenInChunkEnumeration = false) From 734be944cac4e0b716904c9dd1660f9d614dd5ab Mon Sep 17 00:00:00 2001 From: samaysar Date: Wed, 18 Dec 2024 22:00:20 +0100 Subject: [PATCH 3/5] adding ilist chunking without memory consumption, can release 0.7.3, rel prep --- .github/workflows/dotnet-devfast-extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-devfast-extension.yml b/.github/workflows/dotnet-devfast-extension.yml index 3dd27ce..d9f1673 100644 --- a/.github/workflows/dotnet-devfast-extension.yml +++ b/.github/workflows/dotnet-devfast-extension.yml @@ -8,7 +8,7 @@ jobs: buildAndTestFull: strategy: matrix: - dotnet-version: ['6.x.x','7.x.x','8.x.x'] + dotnet-version: ['6.x.x','8.x.x'] runs-on: ubuntu-latest steps: - name: Checkout From 0402331247fb7ea1b176a7b10f20e40d2b7c0009 Mon Sep 17 00:00:00 2001 From: samaysar Date: Wed, 18 Dec 2024 22:03:40 +0100 Subject: [PATCH 4/5] github workflow fix --- .github/workflows/dotnet-devfast-extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-devfast-extension.yml b/.github/workflows/dotnet-devfast-extension.yml index d9f1673..f8621ae 100644 --- a/.github/workflows/dotnet-devfast-extension.yml +++ b/.github/workflows/dotnet-devfast-extension.yml @@ -8,7 +8,7 @@ jobs: buildAndTestFull: strategy: matrix: - dotnet-version: ['6.x.x','8.x.x'] + dotnet-version: ['8.x.x'] runs-on: ubuntu-latest steps: - name: Checkout From 9420fb8b8e80aa272a49dfc07eaf94e2b5c601a3 Mon Sep 17 00:00:00 2001 From: samaysar Date: Wed, 18 Dec 2024 22:10:24 +0100 Subject: [PATCH 5/5] github workflow fix - 2 --- .github/workflows/dotnet-devfast-extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-devfast-extension.yml b/.github/workflows/dotnet-devfast-extension.yml index f8621ae..c3b170e 100644 --- a/.github/workflows/dotnet-devfast-extension.yml +++ b/.github/workflows/dotnet-devfast-extension.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: dotnet-version: ['8.x.x'] - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4