Esempio n. 1
0
        public EFEventStore(EFEventStoreOptions options, ILoggerFactory loggerFactory = null)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _dbContextOptions         = options.DbContextOptions;
            _logger                   = (loggerFactory ?? new LoggerFactory()).CreateLogger <EFEventStore>();
            _snapshotBehaviorProvider = options.SnapshotBehaviorProvider;

            _bufferInfo      = options.BufferInfo;
            _archiveBehavior = options.ArchiveBehavior;
            _archiveBehaviorDbContextOptions = options.ArchiveDbContextOptions;

            if (_bufferInfo != null)
            {
                s_SlidingTimer  = new Timer(TreatBufferEvents, null, Timeout.Infinite, Timeout.Infinite);
                s_AbsoluteTimer = new Timer(TreatBufferEvents, null, Timeout.Infinite, Timeout.Infinite);
            }
        }