Exemple #1
0
        public static void RegisterOutboxToOutboxProcessor(IOutboxProcessor outboxProcessor, Type outboxType,
                                                           string boundedContext, OutboxPublicationType publicationType)
        {
            outboxType.EnsureDerivesFromInterface(typeof(IOutbox));

            MethodInfo?method = outboxProcessor.GetType()
                                .GetMethod(nameof(IOutboxProcessor.Register), 1,
                                           new Type[] { typeof(string), typeof(OutboxPublicationType) });

            MethodInfo?generic = method !.MakeGenericMethod(outboxType);

            generic !.Invoke(outboxProcessor, new object[] { boundedContext, publicationType });
        }
Exemple #2
0
 public OutboxProcessingBehavior(IOutboxProcessor outboxProcessor, ILogger <OutboxProcessingBehavior <TMessage> > logger)
 {
     _outboxProcessor = outboxProcessor ?? throw new ArgumentNullException(nameof(outboxProcessor));
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }