Example #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var eventStore       = new JsonFileEventStore("ExampleEvents.zip", 100);
            var projectionsStore = new InMemoryDatabase();

            var dispatcher   = new Dispatcher(eventStore.Subscribe);
            var stats        = new ProjectionStats(() => System.DateTime.UtcNow);
            var bootstrapper = new CountsProjector(dispatcher, projectionsStore, stats);

            services
            .AddMvc()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            services.AddSingleton <InMemoryDatabase>(projectionsStore);
            services.AddSingleton <ProjectionStats>(stats);

            bootstrapper.Start();
        }
Example #2
0
 public async Task Start()
 {
     await projector.Start();
 }