Interface IChain<T>
Defines an interface for a chain of objects.
Namespace: MADE.Runtime.Actions
Assembly: MADE.Runtime.dll
Syntax
public interface IChain<T>
where T : class
Type Parameters
Name | Description |
---|---|
T | The type of object being chained. |
Methods
| Improve this Doc View SourceInvoke(Action<T>)
Invokes an action with the chain.
Declaration
void Invoke(Action<T> func)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | func | The action to invoke. |
InvokeAsync(Func<T, Task>)
Invokes an asynchronous action with the chain.
Declaration
Task InvokeAsync(Func<T, Task> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task> | func | The asynchronous action to invoke. |
Returns
Type | Description |
---|---|
Task | An asynchronous operation. |
With(T)
Concatenates the current instances in the chain with the specified instance.
Declaration
Chain<T> With(T instance)
Parameters
Type | Name | Description |
---|---|---|
T | instance | The instance to chain. |
Returns
Type | Description |
---|---|
Chain<T> | The updated Chain<T>. |
With(IEnumerable<T>)
Concatenates the current instances in the chain with the specified instances.
Declaration
Chain<T> With(IEnumerable<T> instances)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | instances | The instances to chain. |
Returns
Type | Description |
---|---|
Chain<T> | The updated Chain<T>. |