IOperationContext<TResult>
Namespace: SnowBank.Threading.Operations · interface
Implements: IOperationContext
Represents the context of an Operation
Methods
Failed
OperationResult<TResult> Failed(OperationError error)
Marks this context as failed
error— Description of the error
Returns: Failed operation result
Success
OperationResult<TResult> Success(TResult result)
Marks this context as successful
result— Result of the operation
Returns: Successful operation result
TryGetResult
bool TryGetResult(out TResult result)
Returns the result attached to this context, if it ran successfully
result— Receives the result of the operation, if it was a success
Returns: true if the context was marked as a success; otherwise, false