DbConnector class

Encapsulates a database connection and any current transaction.

public abstract class DbConnector : IAsyncDisposable, IDisposable

Public Members

name description
static Create(…) Creates a new DbConnector.
abstract Connection { get; } The database connection.
virtual SqlSyntax { get; } The SQL syntax used when formatting SQL.
abstract Transaction { get; } The current transaction, if any.
virtual AttachTransaction(…) Attaches a transaction.
abstract BeginTransaction() Begins a transaction.
abstract BeginTransaction(…) Begins a transaction.
abstract BeginTransactionAsync(…) Begins a transaction. (2 methods)
Command(…) Creates a new command. (6 methods)
CommandFormat(…) Creates a new command from a formatted SQL string. (3 methods)
abstract CommitTransaction() Commits the current transaction.
abstract CommitTransactionAsync(…) Commits the current transaction.
abstract Dispose() Disposes the connector.
abstract DisposeAsync() Disposes the connector.
abstract GetConnectionAsync(…) Returns the database connection.
abstract OpenConnection() Opens the connection.
abstract OpenConnectionAsync(…) Opens the connection.
virtual ReleaseConnection() Releases the open connection.
virtual ReleaseConnectionAsync() Releases the open connection.
abstract RollbackTransaction() Rolls back the current transaction.
abstract RollbackTransactionAsync(…) Rolls back the current transaction.
StoredProcedure(…) Creates a new command to access a stored procedure. (3 methods)

Protected Members

name description
DbConnector() The default constructor.
virtual CommandCache { get; } Gets the command cache, if supported.
abstract ProviderMethods { get; } Special methods provided by the database provider.

See Also