public async Task RunAsync() { // Commands var decoratedCommand = new FooCommand { Name = "Decorated command" }; await _executor.ExecuteAsync(decoratedCommand); await _writer.WriteLineAsync("----------------"); var regularCommand = new BarCommand { Name = "Regular command" }; var regularCommandResult = await _executor.ExecuteAsync(regularCommand); await _writer.WriteLineAsync("----------------"); var syncCommand = new BazCommand(); var syncCommandResult = await _executor.ExecuteAsync(syncCommand); await _writer.WriteLineAsync($"Sync command result is `{syncCommandResult}`"); await _writer.WriteLineAsync("----------------"); // Queries var regularQuery = new FooQuery { Number1 = 3, Number2 = 4 }; var regularQueryResult = await _executor.ExecuteAsync(regularQuery); await _writer.WriteLineAsync("----------------"); }
public async Task Handle(BazCommand busCommand) { RecordMessageReceipt(); }