Beispiel #1
0
        /// <summary>
        /// 初始化 <see cref="Database"/> 类的新实例。
        /// </summary>
        protected Database()
        {
            tranStack = new TransactionStack();
            dbScope   = new DatabaseScope(this);
#if !NET35 && !NET40
            taskMgr = new AsyncTaskManager(this);
#endif
        }
Beispiel #2
0
        protected override bool Dispose(bool disposing)
        {
            if (_isScoped && _dbScope != null)
            {
                _dbScope.Dispose();
                _dbScope = null;
            }

            return(base.Dispose(disposing));
        }
Beispiel #3
0
 private void InitDatabaseScope()
 {
     if (DatabaseScope.Current == null)
     {
         _isScoped = true;
         _dbScope  = new DatabaseScope(this);
     }
     else
     {
         _dbScope = DatabaseScope.Current;
     }
 }
Beispiel #4
0
 /// <summary>
 /// 初始化 <see cref="Database"/> 类的新实例。
 /// </summary>
 protected Database()
 {
     tranStack = new TransactionStack();
     dbScope   = new DatabaseScope(this);
 }
Beispiel #5
0
 /// <summary>
 /// 初始化 <see cref="Database"/> 类的新实例。
 /// </summary>
 protected Database()
 {
     tranStack = new TransactionStack();
     dbScope   = new DatabaseScope(this);
     Track     = DefaultCommandTracker.Instance;
 }