public async Task HandleAsync(DeleteRemarkVote command) { await _handler .Run(async() => await _remarkService.DeleteVoteAsync(command.RemarkId, command.UserId)) .OnSuccess(async() => await _bus.PublishAsync(new RemarkVoteDeleted(command.Request.Id, command.UserId, command.RemarkId))) .OnCustomError(ex => _bus.PublishAsync(new DeleteRemarkVoteRejected(command.Request.Id, command.UserId, command.RemarkId, ex.Code, ex.Message))) .OnError(async(ex, logger) => { logger.Error(ex, "Error occured while deleting a remark vote."); await _bus.PublishAsync(new DeleteRemarkVoteRejected(command.Request.Id, command.UserId, command.RemarkId, OperationCodes.Error, ex.Message)); }) .ExecuteAsync(); }