AdoConnection
Ecng.Data
ADO.NET implementation of IDatabaseConnection.
Erbt von: Disposable
Implementiert: IDatabaseConnection, IDisposable
Konstruktoren
AdoConnection
public AdoConnection(DbConnection connection, ISqlDialect dialect)
adoConnection = AdoConnection(connection, dialect)
Creates a new ADO.NET connection wrapper.
- connection
- Database connection.
- dialect
- SQL dialect.
Eigenschaften
Connection
public DbConnection Connection { get; }
value = adoConnection.Connection
Gets the underlying ADO.NET connection.
Dialect
public ISqlDialect Dialect { get; }
value = adoConnection.Dialect
Gets the SQL dialect for this connection.
Methoden
DisposeManaged
protected override void DisposeManaged()
adoConnection.DisposeManaged()
Disposes the managed resources. Override this method to add custom clean up of managed resources.
EnsureOpenAsync
public ValueTask EnsureOpenAsync(CancellationToken cancellationToken)
result = adoConnection.EnsureOpenAsync(cancellationToken)
Ensures the connection is open, awaiting the driver's async open if it is not. Replaces the previous synchronous EnsureOpen which blocked async pipelines while waiting on the underlying network/driver.
VerifyAsync
public Task VerifyAsync(CancellationToken cancellationToken)
result = adoConnection.VerifyAsync(cancellationToken)
Verifies the connection is valid and can be opened.
- cancellationToken
- Cancellation token.