public static void Main(string[] args) { var container = TinyIoCContainer.Current; var eventStore = new JsonFileEventStore("ExampleEvents.zip", 100); var projectionsStore = new InMemoryDatabase(); container.Register(projectionsStore); var dispatcher = new Dispatcher(eventStore.Subscribe); var bootstrapper = new CountsProjector(dispatcher, projectionsStore); var startOptions = new StartOptions($"http://localhost:9000"); using (WebApp.Start(startOptions, builder => builder.UseControllers(container))) { bootstrapper.Start(); Console.WriteLine($"HTTP endpoint available at http://localhost:9000/api/Statistics/CountsPerState"); Console.ReadLine(); } }
public ExampleProjector(IEventMapBuilder <TProjection, string, ProjectionContext> mapBuilder, InMemoryDatabase store, params IExampleProjector[] childProjectors) { this.store = store; var map = BuildMapFrom(mapBuilder); innerProjector = new Projector(map, childProjectors.Select(p => p.InnerProjector)); }
public CountsProjector(Dispatcher dispatcher, InMemoryDatabase store) { this.dispatcher = dispatcher; this.store = store; BuildCountryProjector(); BuildDocumentProjector(); }
public StatisticsController(InMemoryDatabase database) { this.database = database; }
public InMemoryRepository(InMemoryDatabase parent) { this.parent = parent; }