Exemplo n.º 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 });
        }
Exemplo n.º 2
0
 public void Register <TOutbox>(string boundedContext, OutboxPublicationType publicationType)
     where TOutbox : IOutbox
 {
     Registrations.Add(boundedContext, publicationType);
 }