Пример #1
0
 public UnitOfWorkX(DataBaseInfo dataBaseInfo)
 {
     _dbContext            = DbContexts.CreateDbContext <TContext>(dataBaseInfo).Result;
     _dbUnitOfWork         = new UnitOfWork <TContext>(_dbContext);
     _dbContextTransaction = _dbContext.Database.BeginTransaction();
 }
Пример #2
0
 public UnitOfWorkX(DataBaseType dataBaseType, string connectionString)
 {
     _dbContext            = DbContexts.CreateDbContext <TContext>(GetDataBaseInfo(dataBaseType, connectionString)).Result;
     _dbUnitOfWork         = new UnitOfWork <TContext>(_dbContext);
     _dbContextTransaction = _dbContext.Database.BeginTransaction();
 }