Exemplo n.º 1
0
 private void RegisterEventProcessor <T>(IServiceCollection services, IServiceProvider provider,
                                         ServiceBusConfig busConfig, string subscriptionName, ITextSerializer serializer, ILogger <IProcessor> logger)
     where T : IEventHandler
 {
     services.AddSingleton <IProcessor>(busConfig.CreateEventProcessor(
                                            subscriptionName, provider.GetService <T>(), serializer, logger));
 }
 public static void RegisterEventProcessor <T>(this IUnityContainer container, ServiceBusConfig busConfig, string subscriptionName, bool instrumentationEnabled = false)
     where T : IEventHandler
 {
     container.RegisterInstance <IProcessor>(subscriptionName, busConfig.CreateEventProcessor(
                                                 subscriptionName,
                                                 container.Resolve <T>(),
                                                 container.Resolve <ITextSerializer>(),
                                                 instrumentationEnabled));
 }