示例#1
0
        public Auditor(ICallContext callContext, IBusEndpointFactory busFactory)
        {
            Guard.Against.Null(callContext, nameof(callContext));
            Guard.Against.Null(busFactory, nameof(busFactory));

            this.callContext = callContext;
            this.bus         = busFactory.Create <AuditMessage>();
        }
示例#2
0
            public async Task Handle(IssuerCreated notification, CancellationToken cancellationToken)
            {
                logger.LogInformation("IssuerCreated notification received.");

                // create integration event
                var issuerEvent = new IssuerChangedEvent()
                {
                    DateTimeOccuredUtc = dateTime.UtcNow,
                    IssuerName         = notification.IssuerName
                };

                // send integration event to the service bus. Other systems can subscribe to this event if they wish
                var bus = busFactory.Create <IssuerChangedEvent>();
                //await bus.SendAsync(issuerEvent);

                // TODO use details from notification to fill in email dto
                await emailService.SendAsync(new EmailMessageDto());
            }