public EventStoreSubscription(IEventStoreConnection conn, EventStoreOptions options, EventDeserializer eventDeserializer, IEventStoreProjections projections) { _conn = conn; _options = options; _eventDeserializer = eventDeserializer; _projections = projections; }
public void Configure(IApplicationBuilder app, IEventStoreBus eventBus, IEventStoreProjections projections, WebSocketHandler wsHandler, VotingReadModelService readModelService, ILogger <Startup> logger) { app.UseCors("CorsPolicy"); app.UseMvc(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Voting API")); app.UseWebSockets(); app.MapWebSocketManager("/ws", wsHandler); projections.CreateAsync(Projections.Voting) .DefaultRetryAsync() .Wait(); eventBus.Subscribe( async(@event) => { var snapshot = await readModelService.AddOrUpdate(@event); logger.LogInformation(snapshot.ToString()); await wsHandler.SendMessageToAllAsync(snapshot); }) .DefaultRetryAsync() .Wait(); }
public QuizController(IRepository quizRepository, IEventStoreProjections projectionsClient) { _quizRepository = quizRepository; _projectionsClient = projectionsClient; }
public FunnyFactsController(IEventStoreProjections projections) : base() { _projections = projections; }