private void MakeOutgoingCalls(ContextDto context, IEventDto evt)
 {
     foreach (OutgoingCall outgoingCall in _workflowDataAccess.GetWorkflow(context.AppTenantId)[evt.EventType])
     {
         _microserviceProxy.PostAsync(outgoingCall.Uri, CreateBody(outgoingCall.Type, context, evt));
     }
 }
        private object CreateBody(OutgoingCall outgoingCall, ContextDto context, IEventDto evt)
        {
            switch (outgoingCall.Type)
            {
            case OutgoingCallType.Vanilla:
                return(null);

            case OutgoingCallType.EventRaiser:
                return(new EventHandlerDto()
                {
                    CorrelationId = evt.CorrelationId,
                    Uri = $"http://{UriInfo.ServiceName}/{UriInfo.Routes.Event}"
                });

            case OutgoingCallType.AtlasDeliveryService:
                return(new InitiatingEventDto()
                {
                    EventId = Guid.NewGuid(),
                    EventType = outgoingCall.TransformEventType(evt.EventType),
                    CorrelationId = evt.CorrelationId,
                    TimestampUtc = evt.TimestampUtc,
                    AppTenantId = context.AppTenantId,
                    StoreTenantId = context.StoreTenantId,
                    ApplicationId = context.ApplicationId
                });

            default:
                throw new Exception($"Unhandled {nameof(OutgoingCallType)}.");
            }
        }
 private void LogEvent(IEventDto evt)
 {
     _eventLogBusiness.AddEntry(evt.CorrelationId, new EventLogEntryDto()
     {
         Event           = evt,
         TimeReceivedUtc = DateTime.UtcNow
     });
 }