public FeatureBitsEfRepoTests()
        {
            Tuple <FeatureBitsEfDbContext, DbContextOptions <FeatureBitsEfDbContext> > testConfig = FeatureBitEfHelper.SetupDbContext();

            _context = testConfig.Item1;
            _options = testConfig.Item2;
            _it      = new FeatureBitsEfRepo(_context);
        }
Example #2
0
        private static IFeatureBitsRepo GetCorrectRepository(CommonOptions opts)
        {
            IFeatureBitsRepo repo;
            bool             useTable = string.IsNullOrEmpty(opts.DatabaseConnectionString);
            var dbConnStr             = useTable ? opts.AzureTableConnectionString : opts.DatabaseConnectionString;

            if (!useTable)
            {
                DbContextOptionsBuilder <FeatureBitsEfDbContext> options =
                    new DbContextOptionsBuilder <FeatureBitsEfDbContext>();
                options.UseSqlServer(dbConnStr);
                var context = new FeatureBitsEfDbContext(options.Options);
                repo = new FeatureBitsEfRepo(context);
            }
            else
            {
                repo = new FeatureBitsTableStorageRepo(dbConnStr, opts.AzureTableName);
            }

            return(repo);
        }