示例#1
0
文件: UnitOfWork.cs 项目: KienbMi/CCT
        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);
        }
示例#2
0
文件: UnitOfWork.cs 项目: KienbMi/CCT
 public UnitOfWork(ApplicationDbContext dbContext)
 {
     _dbContext        = dbContext;
     PersonRepository  = new PersonRepository(_dbContext);
     SettingRepository = new SettingRepository(_dbContext);
 }