public UnitOfWork() { string actEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); if (actEnvironment != null && actEnvironment.StartsWith("RPI")) { _dbContext = new SqliteContext(actEnvironment); } else { _dbContext = new ApplicationDbContext(); } PersonRepository = new PersonRepository(_dbContext); SettingRepository = new SettingRepository(_dbContext); }
public UnitOfWork(ApplicationDbContext dbContext) { _dbContext = dbContext; PersonRepository = new PersonRepository(_dbContext); SettingRepository = new SettingRepository(_dbContext); }