Пример #1
0
 protected override void DisposeCore()
 {
     if (_dataContext != null)
     {
         _dataContext.Dispose();
     }
 }
Пример #2
0
 /// <summary>
 /// 提交当前单元操作,并释放当前数据库上下文对象
 /// </summary>
 public void Dispose()
 {
     if (!IsCommited)
     {
         Commit();
     }
     _dbContext.Dispose();
 }
Пример #3
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Пример #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         if (disposing)
         {
             _context.Dispose();
         }
     }
     _disposed = true;
 }
Пример #5
0
 public void Dispose()
 {
     _dbContext?.Dispose();
 }
Пример #6
0
 public void Dispose()
 {
     db.Dispose();
 }
Пример #7
0
 public void Dispose()
 {
     _ctx.Dispose();
 }
        public static void Destroy(DemoDbContext context)
        {
            context.Database.EnsureDeleted();

            context.Dispose();
        }