Exemplo n.º 1
0
        public EventStoreRebuilderEngine(
            IInMemoryBus bus,
            ICommandProcessor commandProcessor, ICommandHandlerRegistry commandHandlerRegistry, IEventDispatcher eventDispatcher,
            ITextSerializer serializer, IMetadataProvider metadataProvider,
            ITracer tracer,
            IEventStoreRebuilderConfig config,
            IRebuilderPerfCounter perfCounter)
        {
            this.bus                    = bus;
            this.serializer             = serializer;
            this.eventDispatcher        = eventDispatcher;
            this.commandProcessor       = commandProcessor;
            this.commandHandlerRegistry = commandHandlerRegistry;
            this.config                 = config;
            this.tracer                 = tracer;
            this.metadataProvider       = metadataProvider;
            this.perfCounter            = perfCounter;

            this.sourceContextFactory = () =>
            {
                var context = new EventStoreDbContext(this.config.SourceEventStoreConnectionString);
                context.Configuration.AutoDetectChangesEnabled = false;
                return(context);
            };
            this.newContextFactory = () => new EventStoreDbContext(this.config.NewEventStoreConnectionString);
        }
 public ReadModelRebuilderEngine(Func <EventStoreDbContext> storeContextFactory, ITextSerializer serializer, IEventDispatcher synchronousEventDispatcher, T readModelContext, IRebuilderPerfCounter perfCounter)
 {
     this.storeContextFactory = storeContextFactory;
     this.serializer          = serializer;
     this.eventDispatcher     = synchronousEventDispatcher;
     this.readModelContext    = readModelContext;
     this.perfCounter         = perfCounter;
 }