BaseContext
Represents a connection to a SQL server database.
Gets the identifier of the database.
Whether or not this BaseContext is connected to EDDS.
Gets the name of the database's server.
protected BaseContext()
Starts a transaction against the database.
Asynchronously opens a connection to the database and begins a transaction.
Asynchronously opens a connection to the database and begins a transaction.
Attempts to cancel the current transaction.
Clones this BaseContext using the established connection string.
Commits a transaction to the database.
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.
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.
Asynchronously executes the provided QueryInformation, using ConnectTimeout as its command timeout.
Expects to represent a create, update, or delete query.
Executes a SQL statement against SQL server that does not return data.
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.
public abstract Task<List<T>> ExecuteQueryAsListAsync<T>(QueryInformation query, Func<IDataReader, CancellationToken, Task<T>> 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.
public abstract Task<T> ExecuteQueryAsObjectAsync<T>(QueryInformation query, Func<IDataReader, CancellationToken, Task<T>> converter)
Asynchronously executes the provided QueryInformation, using the provided converter.
Asynchronously executes the provided QueryInformation, using ConnectTimeout as its command timeout.
Asynchronously executes the provided QueryInformation, using ConnectTimeout as its command timeout.
Expects to return exactly one result that can be cast to type T.
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.
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.
Executes a SQL statement that returns a DataTable.
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.
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.
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.
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.
Gets the underlying SqlConnection.
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.
Gets a SqlConnection to the same database as this Context, asynchronously.
Gets the underlying SqlTransaction.
Releases the connection to the database.
Rolls back the in-progress transaction.
Rolls back the in-progress transaction.