private async Task RejectAsync(IRejectedEvent @event) { await _operationService.RejectAsync(@event.RequestId); await _bus.PublishAsync(new OperationUpdated(@event.RequestId, @event.UserId, States.Rejected, DateTime.UtcNow, @event.Reason)); }
private async Task RejectAsync(IRejectedEvent @event) { Logger.Debug($"Reject operation after receiving {@event.GetType().Name} event"); await _operationService.RejectAsync(@event.RequestId, @event.Code, @event.Reason); await _bus.PublishAsync(new OperationUpdated(@event.RequestId, @event.UserId, @event.GetType().Name.Humanize(LetterCasing.LowerCase).Underscore(), States.Rejected, @event.Code, @event.Reason, DateTime.UtcNow)); }
private async Task PublishRejectedEventAndLog(CorrelationContext context, string messageName, ISpan span, IRejectedEvent rejectedEvent) { await _busClient.PublishAsync(rejectedEvent, ctx => ctx.UseMessageContext(context)); _logger.LogInformation($"Published rejected event: '{rejectedEvent.GetType().Name}' for message: '{messageName}' " + $"with correlationId: '{context.Id}'"); span.SetTag("error-type", "domain"); }