Abstract base class for implementator of IDbAccess
Type | Name | Summary |
---|---|---|
InfoMessageEventHandler | InfoMessage | Occurs when the database engine returns a warning of informational message. |
Gets or sets the connection string used to connect to the database.
public String ConnectionString { get; set; }
Default schema for database objects.
public String DefaultSchema { get; set; }
Indicates whether the connection is opened.
public Boolean IsConnectionOpen { get; }
Indicates whether an opened connection is in a transaction.
public Boolean IsInTransaction { get; }
A logger categorized for the database API interface.
public ILogger<IDbAccess> Logger { get; set; }
Gets or sets the name of the connection.
public String Name { get; set; }
Specify how many times a failed operation will be retried.
public Int32 Retries { get; set; }
Adds a new parameter to the command passed as parameter
public Void AddParameter(command, name, type, direction, value)
Name | Type | Summary |
---|---|---|
command | IDbCommand | The command where the parameter will be added |
name | String | The quoted parameter name |
type | DbType | The parameter data type |
direction | ParameterDirection | The parameter direction |
value | Object | The value of the parameter |
Adds a new parameter to the command passed as parameter
public Void AddParameter(command, name, type, direction, size, value)
Name | Type | Summary |
---|---|---|
command | IDbCommand | The command where the parameter will be added |
name | String | The quoted parameter name |
type | DbType | The parameter data type |
direction | ParameterDirection | The parameter direction |
size | Int32 | The size of the data in the valueparameter |
value | Object | The value of the parameter |
Initiates a database transaction
public Void BeginTransaction()
An object representing the new transaction
Initiates a database transaction with the specified isolation level
public Void BeginTransaction(iso)
Ann object representing the new transaction
Name | Type | Summary |
---|---|---|
iso | IsolationLevel | Isolation level for the transaction |
Closes the database connection if it is opened
public Void CloseConnection()
Commits the running database transaction
public Void CommitTransaction()
Creates a new database command
public IDbCommand CreateCommand(commandType)
An object representing the newly created command
Name | Type | Summary |
---|---|---|
commandType | CommandType | Type of the command to create |
Performs applicarion-defined tasks associated with freeing, releasing, or reseting unmaneged resources.
public Void Dispose()
Executes the specified command against the database.
public Int32 ExecuteNonQuery(command)
Quantity of records affected by the command.
Name | Type | Summary |
---|---|---|
command | IDbCommand | Command to execute |
Executes the specified command asyncronously against the database.
public Task ExecuteNonQueryAsync(command)
Quantity of records affected by the command.
Name | Type | Summary |
---|---|---|
command | IDbCommand | Command to execute |
Executes the specified command against the database and returns a IDataReader.
public IDataReader ExecuteReader(command)
A read only forward only IDataReader with the database data.
Name | Type | Summary |
---|---|---|
command | IDbCommand | Command to execute. |
Executes the specified command against the database asyncronously and returns an IDataReader.
public Task ExecuteReaderAsync(command)
Name | Type | Summary |
---|---|---|
command | IDbCommand | Command to execute. |
Executes the specified command against the database and returns the first fields of the first record retrieved
public Object ExecuteScalar(command)
Value of the first field of the first record
Name | Type | Summary |
---|---|---|
command | IDbCommand | Command to excecute |
Executes the specified command againts the database asyncronously and returns the first field of the first record retrieved.
public Task ExecuteScalarAsync(command)
Name | Type | Summary |
---|---|---|
command | IDbCommand | Command to execute. |
Gets the database engine for this API.
public DatabaseEngine GetDatabaseEngine()
Gets the server version.
public String GetServerVersion()
The server version.
Helper to raise the InfoMessage event.
protected Void OnInfoMessage(sender, e)
Name | Type | Summary |
---|---|---|
sender | Object | |
e | InfoMessageEventArgs |
Opens a connection with the database server
public Void OpenConnection()
Opens a connection with the database server asyncronously.
public Task OpenConnectionAsync()
Aborts the current transaction
public Void RollbackTransaction()
In this document