Skip to content

Class DirectExecutionStrategy

Namespace: Cephalon.Behaviors.Patterns.Strategies
Assembly: Cephalon.Behaviors.Patterns.dll

Executes behaviors that follow the direct (request/response) pattern. Returns HTTP 200 when output is non-null, or HTTP 204 No Content when output is null.

public sealed class DirectExecutionStrategy : IBehaviorExecutionStrategy

objectDirectExecutionStrategy

IBehaviorExecutionStrategy

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Gets the pattern identifier handled by this strategy.

public string Pattern { get; }

string

ExecuteAsync(BehaviorExecutionContext, CancellationToken)

Section titled “ ExecuteAsync(BehaviorExecutionContext, CancellationToken)”

Invokes the behavior slot directly and returns the output. Returns HTTP 200 for non-null output and HTTP 204 for null output.

public Task<BehaviorExecutionResult> ExecuteAsync(BehaviorExecutionContext context, CancellationToken ct = default)

context BehaviorExecutionContext

The execution context for this invocation.

ct CancellationToken

A token that cancels the execution.

Task<BehaviorExecutionResult>

A result with HTTP 200 for non-null output or HTTP 204 for null output.