<PackageReference Include="Relativity.Server.Utility.SDK" Version="14.2.7" />

BaseContext

public abstract class BaseContext
Represents a connection to a SQL server database.
public abstract string Database { get; }

Gets the identifier of the database.

public abstract bool IsMasterDatabase { get; }

Whether or not this BaseContext is connected to EDDS.

public abstract string ServerName { get; }

Gets the name of the database's server.

protected BaseContext()

public abstract void BeginTransaction()

Starts a transaction against the database.

public abstract Task BeginTransactionAsync()

Asynchronously opens a connection to the database and begins a transaction.

public abstract Task BeginTransactionAsync(CancellationToken cancelToken)

Asynchronously opens a connection to the database and begins a transaction.

public abstract void Cancel()

Attempts to cancel the current transaction.

public abstract BaseContext Clone()

Clones this BaseContext using the established connection string.

public abstract void CommitTransaction()

Commits a transaction to the database.

public abstract DbParameter CreateDbParameter()

Gets a new instance of DbParameter.

public abstract void ExecuteBulkCopy(IDataReader dataReader, SqlBulkCopyParameters bulkCopyParameters)

Copies data from the provided IDataReader using the provided bulk copy parameters.

public abstract void ExecuteBulkCopy(DataTable dataTable, SqlBulkCopyParameters bulkCopyParameters)

Copies data from the provided DataTable using the provided bulk copy parameters.

public abstract Task ExecuteBulkCopyAsync(IDataReader dataReader, SqlBulkCopyParameters bulkCopyParameters, CancellationToken cancelToken)

Asynchronously executes a bulk copy job from a data reader source, using the provided parameters and cancellation token.

public abstract Task ExecuteBulkCopyAsync(DataTable dataTable, SqlBulkCopyParameters bulkCopyParameters, CancellationToken cancelToken)

Asynchronously executes a bulk copy job from a data table source, using the provided parameters and cancellation token.

public abstract Task<int> ExecuteNonQueryAsync(QueryInformation query)

Asynchronously executes the provided QueryInformation, using ConnectTimeout as its command timeout.

Expects to represent a create, update, or delete query.

public abstract int ExecuteNonQuerySQLStatement(string sqlStatement)

Executes a SQL statement against SQL server that does not return data.

public abstract int ExecuteNonQuerySQLStatement(string sqlStatement, int timeoutValue)

Executes a SQL statement that does not return data, using the provided timeout.

public abstract int ExecuteNonQuerySQLStatement(string sqlStatement, IEnumerable<SqlParameter> parameters)

Executes a SQL statement that does not return data, using the provided set of parameters.

public abstract int ExecuteNonQuerySQLStatement(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue)

Executes a SQL statement that does not return data, using the provided set of parameters and timeout value.

public abstract SqlDataReader ExecuteParameterizedSQLStatementAsReader(string sqlStatement, IEnumerable parameters, int timeoutValue = -1, bool sequentialAccess = false)

Executes a SQL stored procedure that returns a SqlDataReader using the provided set of parameters and timeout with an optional boolean indicating whether or not the statement should leverage sequential access behavior.

public abstract SqlDataReader ExecuteProcedureAsReader(string procedureName, IEnumerable<SqlParameter> parameters, int timeoutValue = -1)

Executes a SQL stored procedure that returns a SqlDataReader using the provided set of parameters and timeout.

public abstract int ExecuteProcedureNonQuery(string procedureName, IEnumerable<SqlParameter> parameters, int timeoutValue = -1)

Executes a SQL stored procedure that does not return data, using the provided set of parameters and timeout.

Asynchronously executes the provided QueryInformation.

Expects to represent a read or query query.

public abstract Task<List<T>> ExecuteQueryAsListAsync<T>(QueryInformation query, Func<IDataReader, Task<T>> converter)

Asynchronously executes the provided QueryInformation, using the provided converter.

Asynchronously executes the provided QueryInformation, using the provided converter.

public abstract Task<T> ExecuteQueryAsObjectAsync<T>(QueryInformation query, Func<IDataReader, Task<T>> converter)

Asynchronously executes the provided QueryInformation, using the provided converter.

Asynchronously executes the provided QueryInformation, using the provided converter.

Asynchronously executes the provided QueryInformation, using ConnectTimeout as its command timeout.

public abstract Task<T> ExecuteQueryAsScalarAsync<T>(QueryInformation query)

Asynchronously executes the provided QueryInformation, using ConnectTimeout as its command timeout. Expects to return exactly one result that can be cast to type T.

public abstract DataSet ExecuteSqlStatementAsDataSet(string statement)

Executes a SQL statement that returns a DataSet.

public abstract DataSet ExecuteSqlStatementAsDataSet(string statement, IEnumerable<SqlParameter> parameters)

Executes a SQL statement that returns a DataSet, using the provided set of parameters.

public abstract DataSet ExecuteSqlStatementAsDataSet(string statement, int timeoutValue)

Executes a SQL statement that returns a DataSet, using the provided set of parameters.

public abstract DataSet ExecuteSqlStatementAsDataSet(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue)

Executes a SQL statement that returns a DataSet, using the provided set of parameters.

public abstract DataTable ExecuteSqlStatementAsDataTable(string sqlStatement)

Executes a SQL statement that returns a DataTable.

public abstract DataTable ExecuteSqlStatementAsDataTable(string sqlStatement, int timeout)

Executes a SQL statement that returns a DataTable, using the provided timeout.

public abstract DataTable ExecuteSqlStatementAsDataTable(string sqlStatement, IEnumerable<SqlParameter> parameters)

Executes a SQL statement that returns DataTable, using the provided set of parameters.

public abstract DataTable ExecuteSqlStatementAsDataTable(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue)

Executes a SQL statement that returns a DataTable, using the provided set of parameters and timeout value.

public abstract DataTable ExecuteSqlStatementAsDataTable(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue, bool retryWithoutHashJoin)

Executes a SQL statement that returns DataTable, using the provided set of parameters, timeout value, and a Boolean indicating whether or not retry the without a hash join.

public abstract DbDataReader ExecuteSqlStatementAsDbDataReader(string sqlStatement)

Executes the specified SQL statement as a Data Reader. If executed in a transaction, the connection will not be closed when the data reader is closed. Otherwise, when the data reader is closed, the connection is closed.

public abstract DbDataReader ExecuteSqlStatementAsDbDataReader(string sqlStatement, int timeoutValue)

Executes the specified SQL statement as a Data Reader. If executed in a transaction, the connection will not be closed when the data reader is closed. Otherwise, when the data reader is closed, the connection is closed.

public abstract DbDataReader ExecuteSqlStatementAsDbDataReader(string sqlStatement, IEnumerable<DbParameter> parameters)

Executes the specified SQL statement as a Data Reader. If executed in a transaction, the connection will not be closed when the data reader is closed. Otherwise, when the data reader is closed, the connection is closed.

public abstract DbDataReader ExecuteSqlStatementAsDbDataReader(string sqlStatement, IEnumerable<DbParameter> parameters, int timeoutValue)

Executes the specified SQL statement as a Data Reader. If executed in a transaction, the connection will not be closed when the data reader is closed. Otherwise, when the data reader is closed, the connection is closed.

public abstract List<T> ExecuteSqlStatementAsList<T>(string sqlStatement, Func<SqlDataReader, T> converter)

Executes a SQL statement that returns a list of strongly-typed results, using the provided converter.

public abstract List<T> ExecuteSqlStatementAsList<T>(string sqlStatement, Func<SqlDataReader, T> converter, int timeoutValue)

Executes a SQL statement that returns a list of strongly-typed results, using the provided converter and timeout.

public abstract List<T> ExecuteSqlStatementAsList<T>(string sqlStatement, Func<SqlDataReader, T> converter, IEnumerable<SqlParameter> parameters)

Executes a SQL statement that returns a list of strongly-typed results, using the provided converter, set of parameters, and timeout.

public abstract List<T> ExecuteSqlStatementAsList<T>(string sqlStatement, Func<SqlDataReader, T> converter, IEnumerable<SqlParameter> parameters, int timeoutValue)

Executes a SQL statement that returns a list of strongly-typed results, using the provided converter, set of parameters, and timeout.

public abstract T ExecuteSqlStatementAsObject<T>(string sqlStatement, Func<SqlDataReader, T> converter)

Executes a SQL statement that expects a single result of type T, using the provided converter.

public abstract T ExecuteSqlStatementAsObject<T>(string sqlStatement, Func<SqlDataReader, T> converter, int timeoutValue)

Executes a SQL statement that expects a single result of type T, using the provided converter and timeout.

public abstract T ExecuteSqlStatementAsObject<T>(string sqlStatement, Func<SqlDataReader, T> converter, IEnumerable<SqlParameter> parameters)

Executes a SQL statement that expects a single result of type T, using the provided converter, set of parameters.

public abstract T ExecuteSqlStatementAsObject<T>(string sqlStatement, Func<SqlDataReader, T> converter, IEnumerable<SqlParameter> parameters, int timeoutValue)

Executes a SQL statement that expects a single result of type T, using the provided converter, set of parameters, and timeout.

public abstract SqlDataReader ExecuteSQLStatementAsReader(string sqlStatement, int timeoutValue = -1)

Executes a SQL statement that returns a SqlDataReader using the provided timeout.

public abstract SqlDataReader ExecuteSQLStatementAsReader(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue = -1)

Executes a SQL statement that returns a SqlDataReader using the provided set of parameters and timeout.

public abstract T ExecuteSqlStatementAsScalar<T>(string sqlStatement)

Executes a SQL statement that expects a single result of type T.

public abstract T ExecuteSqlStatementAsScalar<T>(string sqlStatement, IEnumerable<SqlParameter> parameters)

Executes a SQL statement that expects a single result of type T, using the provided set of parameters.

public virtual T ExecuteSqlStatementAsScalar<T>(string sqlStatement, IEnumerable parameters, bool throwCancelledException, int timeoutValue = -1)

Not implemented.

public abstract T ExecuteSqlStatementAsScalar<T>(string sqlStatement, int timeoutValue)

Executes a SQL statement that expects a single result of type T, using the provided timeout.

public abstract T ExecuteSqlStatementAsScalar<T>(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue)

Executes a SQL statement that expects a single result, cast to the type of T, using the provided set of parameters and timeout.

public abstract T ExecuteSqlStatementAsScalar<T>(string sqlStatement, SqlParameter[] parameterCollection)

Executes a SQL statement that expects a single result, cast to the type of T, using the provided set of parameters and timeout.

public abstract object ExecuteSqlStatementAsScalar(string sqlStatement, SqlParameter[] parameterCollection)

Executes a SQL statement that expects a single generic Object result, using the provided set of parameters and timeout.

public abstract object ExecuteSqlStatementAsScalar(string sqlStatement, IEnumerable parameters, int timeoutValue = -1)

Executes a SQL statement that expects a single generic Object result, cast to the type of T, using the provided set of parameters and timeout.

public virtual object ExecuteSqlStatementAsScalar(string sqlStatement, IEnumerable parameters, bool throwCancelledException, int timeoutValue = -1)

Not implemented. Throws a NotImplementedException.

public abstract object ExecuteSqlStatementAsScalarWithInnerTransaction(string sqlStatement, IEnumerable parameter, int timeoutValue = -1)

Executes a SQL statement that expects a single generic Object result, with an internally managed transaction, using the provided set of parameters and timeout.

public virtual TDataReader ExecuteSqlStatementAsTReader<TDataReader>(string sqlStatement, int timeoutValue = -1) where TDataReader : IDataReader

Executes a SQL statement that returns a generic data reader using the provided timeout.

public virtual TDataReader ExecuteSqlStatementAsTReader<TDataReader>(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue = -1) where TDataReader : IDataReader

Executes a SQL statement that returns a generic data reader using the provided set of parameters and timeout.

public abstract DataTable ExecuteSQLStatementGetSecondDataTable(string sqlStatement, int timeoutValue = -1)

Executes a SQL statement that returns a dataset of multiple tables, returning the second table (0-based index), using the provided set of parameters and timeout.

public abstract SqlConnection GetConnection()

Gets the underlying SqlConnection.

public abstract SqlConnection GetConnection(bool openConnectionIfClosed)

Gets the underlying SqlConnection respecting a flag specifying if the connection should be re-opened.

Gets a SqlConnection to the same database as this Context, asynchronously.

public abstract Task<SqlConnection> GetConnectionAsync(CancellationToken cancellationToken)

Gets a SqlConnection to the same database as this Context, asynchronously.

public abstract SqlTransaction GetTransaction()

Gets the underlying SqlTransaction.

public abstract void ReleaseConnection()

Releases the connection to the database.

public abstract void RollbackTransaction()

Rolls back the in-progress transaction.

public virtual void RollbackTransaction(Exception originationException)

Rolls back the in-progress transaction.