public UnitOfWork(IWebDbContext context) { _context = context as WebDbContext ?? new WebDbContext(); this._objectContext = ((IObjectContextAdapter)_context).ObjectContext; if (_objectContext.Connection.State == ConnectionState.Open ) { _objectContext.Connection.Open(); _transaction = _objectContext.Connection.BeginTransaction(); } }
public UnitOfWorkManager(IWebDbContext context) { Database.SetInitializer<WebDbContext>(null); _context = context as WebDbContext; }