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: 17.0.1.1 588f15fd7550dbf54835f3417a0142d4ea37dbb5
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 methodExecuteEnumerableAsyncT
Asynchronously executes a call to SQL and passes the supplied converter over each of the resulting data records, coalescing that output into an IEnumerableT.
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, IEnumerableSqlParameter)
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, IEnumerableSqlParameter, Int32)
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
Public methodExecuteObjectAsyncT
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 methodExecuteScalarAsyncT
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, IEnumerableSqlParameter)
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, IEnumerableSqlParameter, 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, IEnumerableSqlParameter)
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, IEnumerableSqlParameter)
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, IEnumerableDbParameter)
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, IEnumerableDbParameter, Int32)
Executes a Transact-SQL statement against the connection and builds a DbDataReader.
Public methodExecuteSQLStatementAsEnumerableT
Executes a Transact-SQL statement against the connection and returns the result as an IEnumerableT using the converter delegate.
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, IEnumerableSqlParameter, 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 methodExecuteSqlStatementAsScalarT(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 methodExecuteSqlStatementAsScalarT(String, IEnumerableSqlParameter)
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 methodExecuteSqlStatementAsScalarT(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 methodExecuteSqlStatementAsScalarT(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 methodExecuteSqlStatementAsScalarT(String, IEnumerableSqlParameter, 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