Class CqrsExecutionStrategy
เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน
Namespace: Cephalon.Behaviors.Patterns.Strategies
Assembly: Cephalon.Behaviors.Patterns.dll
Executes behaviors that follow the CQRS (Command Query Responsibility Segregation) pattern. Commands produce no output (returns HTTP 202), queries return a value (HTTP 200).
public sealed class CqrsExecutionStrategy : IBehaviorExecutionStrategyInheritance
Section titled “Inheritance”object ← CqrsExecutionStrategy
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties
Section titled “Properties”Pattern
Section titled “ Pattern”Gets the pattern identifier handled by this strategy.
public string Pattern { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ExecuteAsync(BehaviorExecutionContext, CancellationToken)
Section titled “ ExecuteAsync(BehaviorExecutionContext, CancellationToken)”Invokes the behavior slot and determines the HTTP status code based on whether output was produced. A null output is treated as a command (202 Accepted); a non-null output is treated as a query (200 OK).
public Task<BehaviorExecutionResult> ExecuteAsync(BehaviorExecutionContext context, CancellationToken ct = default)Parameters
Section titled “Parameters”context BehaviorExecutionContext
The execution context for this invocation.
A token that cancels the execution.
Returns
Section titled “Returns”A result with HTTP 200 for queries or HTTP 202 for commands.