IDBContext Interface

Relativity API
Provides a mockable interface with many common helper methods to interact with a database in a Relativity instance. While the Services API should be used to interact with Relativity, the implementation of this interface can be used to interact with the database directly when appropriate.

Namespace:  Relativity.API
Assembly:  Relativity.API (in Relativity.API.dll) Version: 640db774aa42dfbe1785add27fbb41844ec5c7d4
Syntax

public interface IDBContext

The IDBContext type exposes the following members.

Properties

  NameDescription
Public propertyDatabase
Gets a database name.
Public propertyIsMasterDatabase
Checks if database is Master context
Public propertyServerName
Gets a database server name.
Top
Methods

  NameDescription
Public methodBeginTransaction
Starts a database transaction.
Public methodBeginTransactionAsync
Asynchronously opens a transaction against the connected SQL server.
Public methodCancel
Tries to cancel a SQL command execution.
Public methodCommitTransaction
Commits a database transaction.
Public methodCreateDbParameter
Returns a database Parameter
Public methodExecuteBulkCopyAsync
Copies data from the provided IDataReader using the provided ISqlBulkCopyParameters bulk copy parameters.
Public methodExecuteDataTableAsync
Asynchronously executes a call to SQL and collects the results into a DataTable.
Public methodExecuteEnumerableAsync<T>
Public methodExecuteNonQueryAsync
Asychronously executes a call to SQL
Public methodExecuteNonQuerySQLStatement(String)
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
Public methodExecuteNonQuerySQLStatement(String, IEnumerable<SqlParameter>)
Executes a parameterized Transact-SQL statement against the connection and returns the number of rows affected.
Public methodExecuteNonQuerySQLStatement(String, Int32)
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
Public methodExecuteNonQuerySQLStatement(String, IEnumerable<SqlParameter>, Int32)
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
Public methodExecuteObjectAsync<T>
Asynchronously executes a call to SQL and presents the resultant IDataReader to the supplied converter.
Public methodExecuteParameterizedSQLStatementAsReader
Executes a parameterized Transact-SQL statement against the connection and returns a sqlDataReader.
Public methodExecuteProcedureAsReader
Executes a stored procedure against the connection and builds a DbDataReader.
Public methodExecuteProcedureNonQuery
Executes a stored procedure against the connection and returns the number of rows affected.
Public methodExecuteReaderAsync
Asynchronously executes a call to SQL and presents the results as an IDataReader.
Public methodExecuteScalarAsync<T>
Asynchronously executes a call to SQL and returns the value in the first column of the first row in the result set returned by the query. Additional columns or rows are ignored. The value to be returned is coerced to the struct specified in T.
Public methodExecuteSqlBulkCopy
Copies data from the provided IDataReader using the provided ISqlBulkCopyParameters bulk copy parameters.
Public methodExecuteSqlStatementAsDataSet(String)
Executes a Transact-SQL statement against the connection and returns an in-memory cache of data.
Public methodExecuteSqlStatementAsDataSet(String, IEnumerable<SqlParameter>)
Executes a parameterized Transact-SQL statement against the connection and returns an in-memory cache of data.
Public methodExecuteSqlStatementAsDataSet(String, Int32)
Executes a Transact-SQL statement against the connection and returns an in-memory cache of data.
Public methodExecuteSqlStatementAsDataSet(String, IEnumerable<SqlParameter>, Int32)
Executes a parameterized Transact-SQL statement against the connection and returns an in-memory cache of data.
Public methodExecuteSqlStatementAsDataTable(String)
Executes a Transact-SQL statement agains the connection and returns a table of in-memory data.
Public methodExecuteSqlStatementAsDataTable(String, IEnumerable<SqlParameter>)
Executes a parameterized Transact-SQL statement against the connection and returns a table of in-memory data.
Public methodExecuteSqlStatementAsDataTable(String, Int32)
Executes a Transact-SQL statement agains the connection and returns a table of in-memory data.
Public methodExecuteSqlStatementAsDataTable(String, Int32, IEnumerable<SqlParameter>)
Executes a Transact-SQL statement agains the connection and returns a table of in-memory data.
Public methodExecuteSqlStatementAsDbDataReader(String)
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
Public methodExecuteSqlStatementAsDbDataReader(String, IEnumerable<DbParameter>)
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
Public methodExecuteSqlStatementAsDbDataReader(String, Int32)
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
Public methodExecuteSqlStatementAsDbDataReader(String, IEnumerable<DbParameter>, Int32)
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
Public methodExecuteSQLStatementAsEnumerable<T>
Public methodExecuteSQLStatementAsReader
Executes a Transact-SQL statement against the connection and builds a SqlDataReader.
Public methodExecuteSqlStatementAsScalar(String,SqlParameter[])
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteSqlStatementAsScalar(String, IEnumerable<SqlParameter>, Int32)
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteSqlStatementAsScalar<T>(String)
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteSqlStatementAsScalar<T>(String, IEnumerable<SqlParameter>)
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteSqlStatementAsScalar<T>(String,SqlParameter[])
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteSqlStatementAsScalar<T>(String, Int32)
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteSqlStatementAsScalar<T>(String, IEnumerable<SqlParameter>, Int32)
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteSqlStatementAsScalarWithInnerTransaction
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored. ExecuteSqlStatementAsScalarWithInnerTransaction method can be called if context.transaction is not set This method opens transaction internally. This functionality is implemented to enable query rerun in case on the problems with Sql optimizer hints
Public methodExecuteSQLStatementGetSecondDataTable
Executes a Transact-SQL statement against the connection and returns a table of in-memory data.
Public methodGetConnection()
Gets a database connection.
Public methodGetConnection(Boolean)
Gets a database connection, with option to open if closed.
Public methodGetConnectionAsync
Gets a SqlConnection to the same database as this Context, asynchronously.
Public methodGetTransaction
Gets a database transaction.
Public methodReleaseConnection
Releases a database connection.
Public methodRollbackTransaction()
Rolls back a database transaction.
Public methodRollbackTransaction(Exception)
Rolls back a database transaction. Pass in inner exception if rollback times out.
Top
See Also

Reference