/// <summary> /// Builds an operation that throws a <see cref="OpExecutionAbortedException"/>. /// </summary> /// <typeparam name="TValue">The type of value.</typeparam> /// <param name="details">OPTIONAL details to use with the exception. DEFAULT is to omit details.</param> /// <returns> /// The operation. /// </returns> public static ThrowOpExecutionAbortedExceptionOp <TValue> Abort <TValue>( string details = null) { var result = new ThrowOpExecutionAbortedExceptionOp <TValue>(details); return(result); }
/// <inheritdoc /> public TValue Execute( ThrowOpExecutionAbortedExceptionOp <TValue> operation) { if (operation == null) { throw new ArgumentNullException(nameof(operation)); } throw new OpExecutionAbortedException(operation.Details, abortingOperation: operation); }
/// <inheritdoc /> public async Task <TValue> ExecuteAsync( ThrowOpExecutionAbortedExceptionOp <TValue> operation) { if (operation == null) { throw new ArgumentNullException(nameof(operation)); } await Task.FromResult(0); throw new OpExecutionAbortedException(operation.Details, abortingOperation: operation); }