Interface IAsyncBehaviorRule<TContext>
Value agnostic contract for defining an asynchronous behavior rule.
Namespace: Kephas.Behaviors
Assembly: Kephas.Core.dll
Syntax
public interface IAsyncBehaviorRule<in TContext> : IBehaviorRuleFlowControl
Type Parameters
| Name | Description |
|---|---|
| TContext | The context type. |
Methods
| Improve this Doc View SourceCanApplyAsync(TContext, CancellationToken)
Gets a value asynchronously indicating whether the rule may be applied or not.
Declaration
Task<bool> CanApplyAsync(TContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The context. |
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | A promise of a value indicating whether the rule may be applied or not. |
GetValueAsync(TContext, CancellationToken)
Gets the behavior value asynchronously.
Declaration
Task<IBehaviorValue> GetValueAsync(TContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The context. |
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IBehaviorValue> | A promise of the behavior value. |