public async Task <Result> InvokeAsync(TContext context, CancellationToken cancellationToken) { if (await asyncPrecondition.SatisfiedAsync(context).ConfigureAwait(false)) { return(await success.InvokeAsync(context, cancellationToken).ConfigureAwait(false)); } return(Result.Aborted); }
public async Task <Result> InvokeAsync(TContext context, CancellationToken cancellationToken) { if (precondition.Satisfied(context)) { return(await success.InvokeAsync(context, cancellationToken)); } return(Result.None); }
public async Task <Result> InvokeAsync(TInput context, CancellationToken cancellationToken) { if (parser.Parse(context).TryGetValue(out var value)) { return(await command.InvokeAsync(value, cancellationToken).ConfigureAwait(false)); } return(Result.None); }
public async Task <Result> InvokeAsync(TInput context, CancellationToken cancellationToken) { if (parser.Parse(context).TryGetValue(out var option)) { if (option.TryGetValue(out var value)) { return(await command.InvokeAsync(value, cancellationToken)); } return(Result.None); } return(Result.Aborted); }
public async Task <Result> InvokeAsync(TInput context, CancellationToken cancellationToken) { var newContext = await asyncAbortableParser.ParseAsync(context, cancellationToken).ConfigureAwait(false); if (newContext.Completed) { if (newContext.Result.TryGetValue(out var value)) { return(await asyncResultFunc.InvokeAsync(value, cancellationToken).ConfigureAwait(false)); } return(Result.None); } return(Result.Aborted); }