// CallAsync overloads public static async Task <TResult> CallAsync <TResult>(this ICommander commander, ICommand <TResult> command, bool isolate, CancellationToken cancellationToken = default) { var context = commander.Start(command, isolate, cancellationToken); var typedContext = (CommandContext <TResult>)context; return(await typedContext.ResultTask.ConfigureAwait(false)); }
// Start overloads public static CommandContext Start(this ICommander commander, ICommand command, CancellationToken cancellationToken = default) => commander.Start(command, false, cancellationToken);
public static async Task CallAsync(this ICommander commander, ICommand command, bool isolate, CancellationToken cancellationToken = default) { var context = commander.Start(command, isolate, cancellationToken); await context.UntypedResultTask.ConfigureAwait(false); }