コード例 #1
0
        // TODO: Unit test these methods

        public static IIntegrationEventQueue CopyToOutbox(
            this IIntegrationEventQueue eventQueue, IOutboxService outboxService, TimeSpan validitySpan)
        {
            foreach (var @event in eventQueue)
            {
                outboxService.AddObject(
                    @event.EventId, @event.GetType().ToString(), @event, DateTime.Now + validitySpan);
            }

            return(eventQueue);
        }
コード例 #2
0
ファイル: AppDbContext.cs プロジェクト: jhoiby/SafeLien
        public AppDbContext(
            DbContextOptions <AppDbContext> options,
            IDomainEventDispatcher dispatcher,
            IIntegrationEventQueue integrationEvents,
            IServiceBusSender <IIntegrationEvent> busSender,
            IOutboxService outboxService) : base(options)
        {
            _dispatcher        = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
            _integrationEvents = integrationEvents ?? throw new ArgumentNullException(nameof(integrationEvents));
            _busSender         = busSender ?? throw new ArgumentNullException(nameof(busSender));

            _outboxService = outboxService ?? throw new ArgumentNullException(nameof(outboxService));
            _outboxService.AddProvider(this);
        }
コード例 #3
0
 public OutboxController(IErrorLogService _errorLogService, IOutboxService _outboxService, IKycService _kycService)
 {
     outboxService   = _outboxService;
     errorLogService = _errorLogService;
     kycService      = _kycService;
 }
コード例 #4
0
 public static void RemoveFromOutbox(this List <IIntegrationEvent> integrationEvents,
                                     IOutboxService outboxService)
 {
     outboxService.DeleteRange(
         integrationEvents.Select(e => e.EventId).ToArray());
 }