// 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); }
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); }
public OutboxController(IErrorLogService _errorLogService, IOutboxService _outboxService, IKycService _kycService) { outboxService = _outboxService; errorLogService = _errorLogService; kycService = _kycService; }
public static void RemoveFromOutbox(this List <IIntegrationEvent> integrationEvents, IOutboxService outboxService) { outboxService.DeleteRange( integrationEvents.Select(e => e.EventId).ToArray()); }