Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
 public UnitOfWorkManager(IWebDbContext context)
 {
     Database.SetInitializer<WebDbContext>(null);
     _context = context as WebDbContext;
 }