コード例 #1
0
ファイル: UnitOfWork.cs プロジェクト: cvcs/.Net_Testing
        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();
            }
        }
コード例 #2
0
 public UnitOfWorkManager(IWebDbContext context)
 {
     Database.SetInitializer<WebDbContext>(null);
     _context = context as WebDbContext;
 }