Class ImmutableHelper
Inheritance
System.Object
ImmutableHelper
Assembly: Eco.Core.dll
Syntax
public static class ImmutableHelper : Object
Methods
ApplyImmutable<T>(ref T, Func<T, T>)
Declaration
public static void ApplyImmutable<T>(ref T original, Func<T, T> apply)
where T : class
Parameters
Type |
Name |
Description |
T |
original |
|
System.Func<T, T> |
apply |
|
Type Parameters
ApplyImmutable<T, TArg>(ref T, TArg, Func<T, TArg, T>)
Declaration
public static void ApplyImmutable<T, TArg>(ref T original, TArg arg, Func<T, TArg, T> apply)
where T : class
Parameters
Type |
Name |
Description |
T |
original |
|
TArg |
arg |
|
System.Func<T, TArg, T> |
apply |
|
Type Parameters
ApplyImmutable<T, TArg1, TArg2>(ref T, TArg1, TArg2, Func<T, TArg1, TArg2, T>)
Declaration
public static void ApplyImmutable<T, TArg1, TArg2>(ref T original, TArg1 arg1, TArg2 arg2, Func<T, TArg1, TArg2, T> apply)
where T : class
Parameters
Type |
Name |
Description |
T |
original |
|
TArg1 |
arg1 |
|
TArg2 |
arg2 |
|
System.Func<T, TArg1, TArg2, T> |
apply |
|
Type Parameters
Name |
Description |
T |
|
TArg1 |
|
TArg2 |
|
ApplyImmutable<T, TArg1, TArg2, TArg3>(ref T, TArg1, TArg2, TArg3, Func<T, TArg1, TArg2, TArg3, T>)
Declaration
public static void ApplyImmutable<T, TArg1, TArg2, TArg3>(ref T original, TArg1 arg1, TArg2 arg2, TArg3 arg3, Func<T, TArg1, TArg2, TArg3, T> apply)
where T : class
Parameters
Type |
Name |
Description |
T |
original |
|
TArg1 |
arg1 |
|
TArg2 |
arg2 |
|
TArg3 |
arg3 |
|
System.Func<T, TArg1, TArg2, TArg3, T> |
apply |
|
Type Parameters
Name |
Description |
T |
|
TArg1 |
|
TArg2 |
|
TArg3 |
|
ApplyImmutableReturn<T, TResult>(ref T, Func<T, (T, TResult)>)
Applies a passed function to an immutable container, and returns the given value that comes back through the tuple.
Declaration
public static TResult ApplyImmutableReturn<T, TResult>(ref T original, Func<T, (T, TResult)> apply)
where T : class
Parameters
Type |
Name |
Description |
T |
original |
The immutable container this is being run upon
|
System.Func<T, System.ValueTuple<T, TResult>> |
apply |
A function run on every entry of the container, which will return a tuple: (the new updated container, the value to pass back to the caller)
|
Returns
Type |
Description |
TResult |
Returns the result of the application of the func over the container.
|
Type Parameters
Name |
Description |
T |
The immutable container
|
TResult |
The result of the operation. Can be a bool for success, or some other type (like a list for extracting values)
|
ApplyImmutableReturn<T, TArg, TResult>(ref T, TArg, Func<T, TArg, (T, TResult)>)
Declaration
public static TResult ApplyImmutableReturn<T, TArg, TResult>(ref T original, TArg arg, Func<T, TArg, (T, TResult)> apply)
where T : class
Parameters
Type |
Name |
Description |
T |
original |
|
TArg |
arg |
|
System.Func<T, TArg, System.ValueTuple<T, TResult>> |
apply |
|
Returns
Type Parameters
Name |
Description |
T |
|
TArg |
|
TResult |
|
ApplyImmutableReturn<T, TArg1, TArg2, TResult>(ref T, TArg1, TArg2, Func<T, TArg1, TArg2, (T, TResult)>)
Declaration
public static TResult ApplyImmutableReturn<T, TArg1, TArg2, TResult>(ref T original, TArg1 arg1, TArg2 arg2, Func<T, TArg1, TArg2, (T, TResult)> apply)
where T : class
Parameters
Type |
Name |
Description |
T |
original |
|
TArg1 |
arg1 |
|
TArg2 |
arg2 |
|
System.Func<T, TArg1, TArg2, System.ValueTuple<T, TResult>> |
apply |
|
Returns
Type Parameters
Name |
Description |
T |
|
TArg1 |
|
TArg2 |
|
TResult |
|