Skip to content

WrappedConnection class

namespace: Serenity.Data   assemblySerenity.Net.Services

Wraps a connection to add current transaction and dialect support.

public class WrappedConnection : DbConnection, IHasActualConnection, IHasCommandTimeout, 
    IHasConnectionStateChange, IHasCurrentTransaction, IHasDialect, IHasLogger, IHasOpenedOnce

Public Members

name description
WrappedConnection(…) Initializes a new instance of the WrappedConnection class.
ActualConnection { get; } Gets the actual connection instance.
CommandTimeout { get; set; } Gets or sets default command timeout.
override ConnectionString { get; set; } Gets or sets the string used to open a database.
override ConnectionTimeout { get; } Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
CurrentTransaction { get; } Gets the current transaction.
override Database { get; } Gets the name of the current database or the database to be used after a connection is opened.
override DataSource { get; } Gets the name of the database server to which to connect.
Dialect { get; set; } Gets or sets the SQL dialect.
Logger { get; } Gets the logger instance for this connection, if any.
OpenedOnce { get; } Gets a value indicating whether the connection was opened once.
override ServerVersion { get; } Gets the version of the database server.
override State { get; } Gets the current state of the connection.
override ChangeDatabase(…) Changes the current database for an open Connection object.
override Close() Closes the connection to the database.
override CloseAsync() Closes the connection to the database asynchronously.
override DisposeAsync() Disposes the actual connection asynchronously.
override Open() Opens a database connection with the settings specified by the ConnectionString property of the provider-specific Connection object.
override OpenAsync(…) Opens a database connection asynchronously with the settings specified by the ConnectionString property of the provider-specific Connection object.

Protected Members

name description
override DbProviderFactory { get; } Gets the associated provider factory for the connection, or null if the actual connection is not a DbConnection.
override BeginDbTransaction(…) Begins a database transaction with the specified IsolationLevel value.
override BeginDbTransactionAsync(…) Begins a database transaction asynchronously with the specified IsolationLevel value.
override CreateDbCommand() Creates and returns a Command object associated with the connection.
override Dispose(…) Disposes the actual connection.

See Also