Exemple #1
0
        public EventSourceFacade(IStreamResolver streamResolver, IDatabaseLookup databaseLookup)
        {
            var dbPath  = databaseLookup.GetDatabase(streamResolver.GetStream());
            var options = new DbContextOptionsBuilder <DomainContext>()
                          .UseSqlite($"Data Source={dbPath}")
                          .Options;

            _context = new DomainContext(options);
        }
Exemple #2
0
        public ReadModel(IStreamResolver streamResolver, IEventLookup eventLookup,
                         IDataContext dataContext, IDatabaseLookup databaseLookup)
        {
            _eventLookup = eventLookup;
            _dataContext = dataContext;

            _eventHandlers = new List <Action <BaseEvent> >();

            var eventDbFile = databaseLookup.GetDatabase(streamResolver.GetStream());
            var options     = new DbContextOptionsBuilder <DomainContext>()
                              .UseSqlite($"Data Source={eventDbFile}")
                              .Options;

            _context = new DomainContext(options);
        }