public void Dispose() { if (_connection != null) { _connection.Dispose(); } }
void IDisposable.Dispose() { EntityConnection connection = connections[this.type]; connections[this.type] = null; connection.Dispose(); }
void IDisposable.Dispose() { EntityConnection connection = connections[this.type]; // restore cached connection - null is fine and means that connection has to be recreated connections[this.type] = cachedConnection; connection.Dispose(); }
private static bool IsServerConnected(string connectionString) { using var connection = new EntityConnection(connectionString); try { connection.Open(); connection.Close(); connection.Dispose(); return(true); } catch (EntityException) { connection.Close(); connection.Dispose(); return(false); } }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing && _entityConnection != null) { _entityConnection.Dispose(); } }
public void Dispose() { if (entities != null) { entities.Dispose(); } if (entityConnection != null) { entityConnection.Dispose(); } }
/// <summary> /// 初始化AppRoot /// </summary> public static void Inital() { //模型对象初始化 instance = null; instance = new AppRoot(); //连接初始化 if (connection != null) { connection.Dispose(); } connection = new EntityConnection(Helper.CreateConnectString()); connection.Open(); }
public override void TearDownSample() { if (context != null) { context.Dispose(); context = null; } if (schemaConnection != null) { schemaConnection.Dispose(); schemaConnection = null; } base.TearDownSample(); }
/// <summary> /// 初始化AppRoot /// </summary> public static void Inital() { //模型对象初始化 instance = null; instance = new AppRoot(); //连接初始化 ThreadPool.QueueUserWorkItem(delegate { if (connection != null) { connection.Dispose(); } connection = new EntityConnection(Helper.CreateConnectString()); connection.Open(); }); }
protected virtual void Dispose(bool disposing) { if (!_disposed) { if (disposing) { if (_connection != null) { _connection.Dispose(); _connection = null; } if (_entityConnection != null) { _entityConnection.Dispose(); _entityConnection = null; } } } _disposed = true; }
public virtual void Dispose() { _entityConnection.Dispose(); }
public virtual void Dispose() { dataContext.Dispose(); entConn.Dispose(); }