public async Task <CommandHandlingResult> Handle(Commands.SaveIssueOperationStateCommand command, IEventPublisher eventPublisher) { await SaveState(command.Command, command.Context); eventPublisher.PublishEvent(new IssueTransactionStateSavedEvent { Message = command.Message, Command = command.Command }); return(CommandHandlingResult.Ok()); }
public async Task <CommandHandlingResult> Handle(Commands.SaveIssueOperationStateCommand command, IEventPublisher eventPublisher) { var sw = new Stopwatch(); sw.Start(); try { await SaveState(command.Command, command.Context); eventPublisher.PublishEvent(new IssueTransactionStateSavedEvent { Message = command.Message, Command = command.Command }); return(CommandHandlingResult.Ok()); } finally { sw.Stop(); _log.Info("Command execution time", context: new { TxHandler = new { Handler = nameof(OperationsCommandHandler), Command = nameof(Commands.SaveIssueOperationStateCommand), Time = sw.ElapsedMilliseconds } }); } }