public void Open() { if (DbConnection.State == ConnectionState.Broken) { DbConnection.Close(); } if (DbConnection.State == ConnectionState.Closed) { DbConnection.Open(); //so the internal connection is wrapped for example by miniprofiler if (Factory.ConnectionFilter != null) { dbConnection = Factory.ConnectionFilter(dbConnection); } DialectProvider.OnOpenConnection?.Invoke(dbConnection); } }
public void Open() { if (isOpen) { return; } DbConnection.Open(); //so the internal connection is wrapped for example by miniprofiler if (Factory.ConnectionFilter != null) { dbConnection = Factory.ConnectionFilter(dbConnection); } isOpen = true; }