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