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
The IDBContext type exposes the following members.
Properties
Name | Description | |
---|---|---|
![]() | Database |
Gets a database name.
|
![]() | IsMasterDatabase |
Checks if database is Master context
|
![]() | ServerName |
Gets a database server name.
|
Methods
Name | Description | |
---|---|---|
![]() | BeginTransaction |
Starts a database transaction.
|
![]() | BeginTransactionAsync |
Asynchronously opens a transaction against the connected SQL server.
|
![]() | Cancel |
Tries to cancel a SQL command execution.
|
![]() | CommitTransaction |
Commits a database transaction.
|
![]() | CreateDbParameter |
Returns a database Parameter
|
![]() | ExecuteBulkCopyAsync |
Copies data from the provided IDataReader using the provided ISqlBulkCopyParameters bulk copy parameters.
|
![]() | ExecuteDataTableAsync |
Asynchronously executes a call to SQL and collects the results into a DataTable.
|
![]() | ExecuteEnumerableAsync<T> |
Asynchronously executes a call to SQL and passes the supplied converter over each of the
resulting data records, coalescing that output into an IEnumerable<T>.
|
![]() | ExecuteNonQueryAsync |
Asychronously executes a call to SQL
|
![]() | ExecuteNonQuerySQLStatement(String) |
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
|
![]() | ExecuteNonQuerySQLStatement(String, IEnumerable<SqlParameter>) |
Executes a parameterized Transact-SQL statement against the connection and returns the number of rows affected.
|
![]() | ExecuteNonQuerySQLStatement(String, Int32) |
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
|
![]() | ExecuteNonQuerySQLStatement(String, IEnumerable<SqlParameter>, Int32) |
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
|
![]() | ExecuteObjectAsync<T> |
Asynchronously executes a call to SQL and presents the resultant IDataReader to the supplied converter.
|
![]() | ExecuteParameterizedSQLStatementAsReader |
Executes a parameterized Transact-SQL statement against the connection and returns a sqlDataReader.
|
![]() | ExecuteProcedureAsReader |
Executes a stored procedure against the connection and builds a DbDataReader.
|
![]() | ExecuteProcedureNonQuery |
Executes a stored procedure against the connection and returns the number of rows affected.
|
![]() | ExecuteReaderAsync |
Asynchronously executes a call to SQL and presents the results as an IDataReader.
|
![]() | ExecuteScalarAsync<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.
|
![]() | ExecuteSqlBulkCopy |
Copies data from the provided IDataReader using the provided ISqlBulkCopyParameters bulk copy parameters.
|
![]() | ExecuteSqlStatementAsDataSet(String) |
Executes a Transact-SQL statement against the connection and returns an in-memory cache of data.
|
![]() | ExecuteSqlStatementAsDataSet(String, IEnumerable<SqlParameter>) |
Executes a parameterized Transact-SQL statement against the connection and returns an in-memory cache of data.
|
![]() | ExecuteSqlStatementAsDataSet(String, Int32) |
Executes a Transact-SQL statement against the connection and returns an in-memory cache of data.
|
![]() | ExecuteSqlStatementAsDataSet(String, IEnumerable<SqlParameter>, Int32) |
Executes a parameterized Transact-SQL statement against the connection and returns an in-memory cache of data.
|
![]() | ExecuteSqlStatementAsDataTable(String) |
Executes a Transact-SQL statement agains the connection and returns a table of in-memory data.
|
![]() | ExecuteSqlStatementAsDataTable(String, IEnumerable<SqlParameter>) |
Executes a parameterized Transact-SQL statement against the connection and returns a table of in-memory data.
|
![]() | ExecuteSqlStatementAsDataTable(String, Int32) |
Executes a Transact-SQL statement agains the connection and returns a table of in-memory data.
|
![]() | ExecuteSqlStatementAsDataTable(String, Int32, IEnumerable<SqlParameter>) |
Executes a Transact-SQL statement agains the connection and returns a table of in-memory data.
|
![]() | ExecuteSqlStatementAsDbDataReader(String) |
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
|
![]() | ExecuteSqlStatementAsDbDataReader(String, IEnumerable<DbParameter>) |
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
|
![]() | ExecuteSqlStatementAsDbDataReader(String, Int32) |
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
|
![]() | ExecuteSqlStatementAsDbDataReader(String, IEnumerable<DbParameter>, Int32) |
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
|
![]() | ExecuteSQLStatementAsEnumerable<T> |
Executes a Transact-SQL statement against the connection and returns the result as an IEnumerable<T> using the converter delegate.
|
![]() | ExecuteSQLStatementAsReader |
Executes a Transact-SQL statement against the connection and builds a SqlDataReader.
|
![]() | ExecuteSqlStatementAsScalar(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.
|
![]() | ExecuteSqlStatementAsScalar(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.
|
![]() | ExecuteSqlStatementAsScalar<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.
|
![]() | ExecuteSqlStatementAsScalar<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.
|
![]() | ExecuteSqlStatementAsScalar<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.
|
![]() | ExecuteSqlStatementAsScalar<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.
|
![]() | ExecuteSqlStatementAsScalar<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.
|
![]() | ExecuteSqlStatementAsScalarWithInnerTransaction |
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
|
![]() | ExecuteSQLStatementGetSecondDataTable |
Executes a Transact-SQL statement against the connection and returns a table of in-memory data.
|
![]() | GetConnection() |
Gets a database connection.
|
![]() | GetConnection(Boolean) |
Gets a database connection, with option to open if closed.
|
![]() | GetConnectionAsync |
Gets a SqlConnection to the same database as this Context, asynchronously.
|
![]() | GetTransaction |
Gets a database transaction.
|
![]() | ReleaseConnection |
Releases a database connection.
|
![]() | RollbackTransaction() |
Rolls back a database transaction.
|
![]() | RollbackTransaction(Exception) |
Rolls back a database transaction. Pass in inner exception if rollback times out.
|
See Also