public PublishedEventPersistenter(IIdentityGenerator identityGenerator, EventBusMySQLOptions eventBusMySQLOptions, IServiceProvider serviceProvider, ILogger <PublishedEventPersistenter> logger)
 {
     _identityGenerator    = identityGenerator;
     _eventBusMySQLOptions = eventBusMySQLOptions;
     _serviceProvider      = serviceProvider;
     _logger = logger;
 }
Ejemplo n.º 2
0
 public ReceivedEventPersistenter(EventBusMySQLOptions eventBusMySQLOptions,
                                  ILogger <ReceivedEventPersistenter> logger,
                                  IServiceProvider serviceProvider)
 {
     _eventBusMySQLOptions = eventBusMySQLOptions;
     _logger          = logger;
     _serviceProvider = serviceProvider;
 }
        public void AddServices(IServiceCollection serviceCollection)
        {
            var options = new EventBusMySQLOptions();

            _configure(serviceCollection.BuildServiceProvider(), options);

            serviceCollection.AddSingleton(options);
            serviceCollection.AddScoped <IPublishedEventPersistenter, PublishedEventPersistenter>();
            serviceCollection.AddScoped <IIdentityGenerator, IdentityGenerator>();
            serviceCollection.AddScoped <IConnectionFactoryAccessor, DefaultConnectionFactoryAccessor>();
            serviceCollection.AddScoped <IEventPublisher, EventPublisher>();
        }