Пример #1
0
        public StoreRepository()
        {
            var optionsBuilder = new DbContextOptionsBuilder <StoredbContext>();

            optionsBuilder.UseSqlServer(StoreRepository.GetConnectionString());
            _contextOptions = optionsBuilder.Options;
        }
Пример #2
0
        public StoreRepository(StreamWriter logger)
        {
            var optionsBuilder = new DbContextOptionsBuilder <StoredbContext>();

            optionsBuilder.UseSqlServer(StoreRepository.GetConnectionString());
            optionsBuilder.LogTo(logger.WriteLine, LogLevel.Information);
            _contextOptions = optionsBuilder.Options;
        }