Class DBExecutor
Inheritance
System.Object
DBExecutor
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Terrasoft.Core.dll
Syntax
public abstract class DBExecutor : IDisposable
Constructors
DBExecutor(UserConnection)
Declaration
protected DBExecutor(UserConnection userConnection)
Parameters
DBExecutor(UserConnection, QueryKind)
Declaration
protected DBExecutor(UserConnection userConnection, QueryKind queryKind)
Parameters
Type |
Name |
Description |
UserConnection |
userConnection |
|
QueryKind |
queryKind |
|
Properties
BinaryPackageSize
Declaration
public static int BinaryPackageSize { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
CommandTimeout
Declaration
public int CommandTimeout { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
ConnectionString
Declaration
public static string ConnectionString { get; set; }
Property Value
Type |
Description |
System.String |
|
ConnetionDepth
Declaration
public int ConnetionDepth { get; }
Property Value
Type |
Description |
System.Int32 |
|
CurrentSchemaName
Declaration
public static string CurrentSchemaName { get; set; }
Property Value
Type |
Description |
System.String |
|
DBCommandSettings
Declaration
public static DBSectionCollection DBCommandSettings { get; set; }
Property Value
DBConnection
Declaration
protected DbConnection DBConnection { get; }
Property Value
Type |
Description |
System.Data.Common.DbConnection |
|
DBSessionSettings
Declaration
public static DBSectionCollection DBSessionSettings { get; set; }
Property Value
EnableSqlLog
Declaration
public static bool EnableSqlLog { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
IsOffsetPagingFeatureEnabled
Declaration
protected virtual bool IsOffsetPagingFeatureEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
Logger
Declaration
protected ILog Logger { get; }
Property Value
QueryKind
Declaration
protected QueryKind QueryKind { get; set; }
Property Value
Type |
Description |
QueryKind |
|
ServerVersion
Declaration
protected virtual Version ServerVersion { get; }
Property Value
Type |
Description |
System.Version |
|
TransactionDepth
Declaration
public int TransactionDepth { get; }
Property Value
Type |
Description |
System.Int32 |
|
UseDaylightSavingTimeSupport
Declaration
protected virtual bool UseDaylightSavingTimeSupport { get; }
Property Value
Type |
Description |
System.Boolean |
|
UserConnection
Declaration
public UserConnection UserConnection { get; }
Property Value
Methods
BeginTransaction(IsolationLevel)
Declaration
protected virtual DbTransaction BeginTransaction(IsolationLevel isolationLevel)
Parameters
Type |
Name |
Description |
System.Data.IsolationLevel |
isolationLevel |
|
Returns
Type |
Description |
System.Data.Common.DbTransaction |
|
BuildConnectionString(String, String)
Declaration
protected abstract string BuildConnectionString(string userName, string password)
Parameters
Type |
Name |
Description |
System.String |
userName |
|
System.String |
password |
|
Returns
Type |
Description |
System.String |
|
Close()
Declaration
CommitTransaction()
Commits the database transaction.
Declaration
public virtual void CommitTransaction()
DBParametersToQueryParameters(DbParameterCollection, QueryParameterCollection)
Declaration
protected abstract void DBParametersToQueryParameters(DbParameterCollection dbParameters, QueryParameterCollection queryParameters)
Parameters
Dispose()
Declaration
Dispose(Boolean)
Declaration
protected void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
true to release both managed and unmanaged resources; false
to release only unmanaged resources.
|
Execute(String)
Executes a SQL statement against a connection object.
Declaration
[Obsolete("This method is obsolete. Use IDBCommand.Execute instead.")]
public virtual int Execute(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
System.Int32 |
The number of rows affected.
|
Execute(String, QueryParameterCollection)
Executes a SQL statement with parameters, if any, against a connection object.
Declaration
[Obsolete("This method is obsolete. Use IDBCommand.Execute instead.")]
public virtual int Execute(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Int32 |
The number of rows affected.
|
ExecuteBatches(String)
Declaration
[Obsolete("This method is obsolete. Use IDBCommand.Execute instead.")]
public void ExecuteBatches(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
|
ExecuteCommand<TResult>(Func<DbCommand, TResult>, String, QueryParameterCollection)
Declaration
protected TResult ExecuteCommand<TResult>(Func<DbCommand, TResult> commandExecutionCallback, string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.Func<System.Data.Common.DbCommand, TResult> |
commandExecutionCallback |
|
System.String |
sqlText |
|
QueryParameterCollection |
queryParameters |
|
Returns
Type Parameters
ExecuteCommand<TResult>(Func<DbCommand, TResult>, String, QueryParameterCollection, CancellationToken)
Declaration
protected TResult ExecuteCommand<TResult>(Func<DbCommand, TResult> commandExecutionCallback, string sqlText, QueryParameterCollection queryParameters, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.Func<System.Data.Common.DbCommand, TResult> |
commandExecutionCallback |
|
System.String |
sqlText |
|
QueryParameterCollection |
queryParameters |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type Parameters
ExecuteCommandAsync<TResult>(Func<DbCommand, Task<TResult>>, String, QueryParameterCollection)
Declaration
protected async Task<TResult> ExecuteCommandAsync<TResult>(Func<DbCommand, Task<TResult>> commandExecutionCallback, string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.Func<System.Data.Common.DbCommand, System.Threading.Tasks.Task<TResult>> |
commandExecutionCallback |
|
System.String |
sqlText |
|
QueryParameterCollection |
queryParameters |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TResult> |
|
Type Parameters
ExecuteCommandAsync<TResult>(Func<DbCommand, Task<TResult>>, String, QueryParameterCollection, CancellationToken)
Declaration
protected Task<TResult> ExecuteCommandAsync<TResult>(Func<DbCommand, Task<TResult>> commandExecutionCallbackAsync, string sqlText, QueryParameterCollection queryParameters, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.Func<System.Data.Common.DbCommand, System.Threading.Tasks.Task<TResult>> |
commandExecutionCallbackAsync |
|
System.String |
sqlText |
|
QueryParameterCollection |
queryParameters |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TResult> |
|
Type Parameters
ExecuteReader(String)
Sends SQL command text to the connection, and builds a DataReader.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteReader instead.")]
public virtual IDataReader ExecuteReader(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
ExecuteReader(String, CancellationToken)
Sends SQL command text to the connection, and builds a DataReader.
Command execution can be cancelled with the token.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteReader instead.")]
public virtual IDataReader ExecuteReader(string sqlText, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
ExecuteReader(String, QueryParameterCollection)
Sends SQL command text and its parameters to the connection, and builds a DataReader.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteReader instead.")]
public virtual IDataReader ExecuteReader(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
ExecuteReader(String, QueryParameterCollection, CommandBehavior)
Sends SQL command text and its parameters to the connection, and builds a DataReader
using one of the CommandBehavior values.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteReader instead.")]
public virtual IDataReader ExecuteReader(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
ExecuteReader(String, QueryParameterCollection, CommandBehavior, CancellationToken)
Sends SQL command text and its parameters to the connection, and builds a DataReader
using one of the CommandBehavior values.
Command execution can be cancelled with the token.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteReader instead.")]
public virtual IDataReader ExecuteReader(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
ExecuteReader(String, QueryParameterCollection, CancellationToken)
Sends SQL command text and its parameters to the connection, and builds a DataReader.
Command execution can be cancelled with the token.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteReader instead.")]
public virtual IDataReader ExecuteReader(string sqlText, QueryParameterCollection queryParameters, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
ExecuteScalar<TResult>(String)
Executes a SQL statement and returns the first column of the first row in the result set
returned by the query. Additional columns or rows are ignored.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteScalar instead.")]
public virtual TResult ExecuteScalar<TResult>(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
TResult |
Scalar value of the given result type.
|
Type Parameters
ExecuteScalar<TResult>(String, QueryParameterCollection)
Executes a SQL statement with parameters, and returns the first column of the first row
in the result set returned by the query. Additional columns or rows are ignored.
Declaration
[Obsolete("This method is obsolete. Use IDBReadableCommand.ExecuteScalar instead.")]
public virtual TResult ExecuteScalar<TResult>(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
Returns
Type |
Description |
TResult |
Scalar value of the given result type.
|
Type Parameters
FailoverExecute<TResult>(DbCommand, Func<TResult>)
Declaration
protected virtual TResult FailoverExecute<TResult>(DbCommand command, Func<TResult> func)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.Func<TResult> |
func |
|
Returns
Type Parameters
FailoverExecute<TResult>(DbCommand, Func<CommandBehavior, TResult>, CommandBehavior)
Declaration
[Obsolete("7.12.3 | Method is not in use and will be removed in upcoming builds")]
protected virtual TResult FailoverExecute<TResult>(DbCommand command, Func<CommandBehavior, TResult> func, CommandBehavior behavior)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.Func<System.Data.CommandBehavior, TResult> |
func |
|
System.Data.CommandBehavior |
behavior |
|
Returns
Type Parameters
FailoverExecuteAsync<TResult>(DbCommand, Func<Task<TResult>>)
Declaration
protected virtual Task<TResult> FailoverExecuteAsync<TResult>(DbCommand command, Func<Task<TResult>> func)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.Func<System.Threading.Tasks.Task<TResult>> |
func |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TResult> |
|
Type Parameters
FailoverExecuteReader(DbCommand, Func<CommandBehavior, IDataReader>, CommandBehavior)
Declaration
protected virtual IDataReader FailoverExecuteReader(DbCommand command, Func<CommandBehavior, IDataReader> func, CommandBehavior behavior)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.Func<System.Data.CommandBehavior, System.Data.IDataReader> |
func |
|
System.Data.CommandBehavior |
behavior |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
FailoverExecuteReader(DbCommand, Func<IDataReader>)
Declaration
protected virtual IDataReader FailoverExecuteReader(DbCommand command, Func<IDataReader> func)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.Func<System.Data.IDataReader> |
func |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
FailoverExecuteReaderAsync(DbCommand, Func<Task<IDataReader>>)
Declaration
protected virtual async Task<IDataReader> FailoverExecuteReaderAsync(DbCommand command, Func<Task<IDataReader>> func)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.Func<System.Threading.Tasks.Task<System.Data.IDataReader>> |
func |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
|
GetConnectionString(QueryKind)
Declaration
protected virtual string GetConnectionString(QueryKind kind)
Parameters
Type |
Name |
Description |
QueryKind |
kind |
|
Returns
Type |
Description |
System.String |
|
GetDataReader(IDataReader, DbCommand)
Wraps data reader into logging proxy if logging is enabled.
Declaration
protected IDataReader GetDataReader(IDataReader dataReader, DbCommand command)
Parameters
Type |
Name |
Description |
System.Data.IDataReader |
dataReader |
The data reader.
|
System.Data.Common.DbCommand |
command |
The command.
|
Returns
Type |
Description |
System.Data.IDataReader |
|
InitilizeConnectionAfterOpen(DbConnection)
Declaration
protected abstract void InitilizeConnectionAfterOpen(DbConnection dbConnection)
Parameters
Type |
Name |
Description |
System.Data.Common.DbConnection |
dbConnection |
|
InternalExecute(String)
Executes a SQL statement against a connection object.
Declaration
protected virtual int InternalExecute(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
System.Int32 |
The number of rows affected.
|
InternalExecute(String, QueryParameterCollection)
Executes a SQL statement with parameters, if any, against a connection object.
Declaration
protected virtual int InternalExecute(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Int32 |
The number of rows affected.
|
InternalExecuteAsync(String)
An asynchronous version of InternalExecute, which executes a SQL statement against a connection object.
Declaration
protected virtual async Task<int> InternalExecuteAsync(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
The number of rows affected.
|
InternalExecuteAsync(String, QueryParameterCollection)
An asynchronous version of InternalExecute, which executes a SQL statement with parameters, if any,
against a connection object.
Declaration
protected virtual async Task<int> InternalExecuteAsync(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
The number of rows affected.
|
InternalExecuteReader(String)
Sends SQL command text to the connection, and builds a DataReader.
Declaration
protected virtual IDataReader InternalExecuteReader(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReader(String, CancellationToken)
Sends SQL command text to the connection, and builds a DataReader.
Command execution can be cancelled with the token.
Declaration
protected virtual IDataReader InternalExecuteReader(string sqlText, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReader(String, QueryParameterCollection)
Sends SQL command text and its parameters to the connection, and builds a DataReader.
Declaration
protected virtual IDataReader InternalExecuteReader(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReader(String, QueryParameterCollection, CommandBehavior)
Sends SQL command text and its parameters to the connection, and builds a DataReader
using one of the CommandBehavior values.
Declaration
protected virtual IDataReader InternalExecuteReader(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReader(String, QueryParameterCollection, CommandBehavior, CancellationToken)
Sends SQL command text and its parameters to the connection, and builds a DataReader
using one of the CommandBehavior values.
Command execution can be cancelled with the token.
Declaration
protected virtual IDataReader InternalExecuteReader(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReader(String, QueryParameterCollection, CancellationToken)
Sends SQL command text and its parameters to the connection, and builds a DataReader.
Command execution can be cancelled with the token.
Declaration
protected virtual IDataReader InternalExecuteReader(string sqlText, QueryParameterCollection queryParameters, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReaderAsync(String)
An asynchronous version of InternalExecuteReader, which sends SQL command text to the connection, and builds
a DataReader.
Declaration
protected virtual async Task<IDataReader> InternalExecuteReaderAsync(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReaderAsync(String, CancellationToken)
An asynchronous version of InternalExecuteReader, which sends SQL command text to the connection, and builds
a DataReader.
Command execution can be cancelled with the token.
Declaration
protected virtual async Task<IDataReader> InternalExecuteReaderAsync(string sqlText, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReaderAsync(String, QueryParameterCollection)
An asynchronous version of InternalExecuteReader, which sends SQL command text and its parameters to the
connection, and builds a DataReader.
Declaration
protected virtual async Task<IDataReader> InternalExecuteReaderAsync(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReaderAsync(String, QueryParameterCollection, CommandBehavior)
An asynchronous version of InternalExecuteReader, which sends SQL command text and its parameters
to the connection, and builds a DataReader using one of the CommandBehavior values.
Declaration
protected virtual async Task<IDataReader> InternalExecuteReaderAsync(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReaderAsync(String, QueryParameterCollection, CommandBehavior, CancellationToken)
An asynchronous version of InternalExecuteReader, which sends SQL command text and its parameters to the
connection, and builds a DataReader using one of the CommandBehavior values.
Command execution can be cancelled with the token.
Declaration
protected virtual async Task<IDataReader> InternalExecuteReaderAsync(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteReaderAsync(String, QueryParameterCollection, CancellationToken)
An asynchronous version of InternalExecuteReader, which sends SQL command text and its parameters to the
connection, and builds a DataReader.
Command execution can be cancelled with the token.
Declaration
protected virtual async Task<IDataReader> InternalExecuteReaderAsync(string sqlText, QueryParameterCollection queryParameters, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
InternalExecuteScalar<TResult>(String)
Executes a SQL statement and returns the first column of the first row in the result set
returned by the query. Additional columns or rows are ignored.
Declaration
protected virtual TResult InternalExecuteScalar<TResult>(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
TResult |
Scalar value of the given result type.
|
Type Parameters
InternalExecuteScalar<TResult>(String, QueryParameterCollection)
Executes a SQL statement with parameters, and returns the first column of the first row
in the result set returned by the query. Additional columns or rows are ignored.
Declaration
protected virtual TResult InternalExecuteScalar<TResult>(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
Returns
Type |
Description |
TResult |
Scalar value of the given result type.
|
Type Parameters
InternalExecuteScalarAsync<TResult>(String)
An asynchronous version of InternalExecuteScalar, which executes a SQL statement and returns the first
column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Declaration
protected virtual async Task<TResult> InternalExecuteScalarAsync<TResult>(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TResult> |
Scalar value of the given result type.
|
Type Parameters
InternalExecuteScalarAsync<TResult>(String, QueryParameterCollection)
An asynchronous version of InternalExecuteScalar, which executes a SQL statement with parameters.
Declaration
protected virtual async Task<TResult> InternalExecuteScalarAsync<TResult>(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TResult> |
Scalar value of the given result type.
|
Type Parameters
NewCommand()
Declaration
protected abstract DbCommand NewCommand()
Returns
Type |
Description |
System.Data.Common.DbCommand |
|
NewConnection()
Declaration
protected abstract DbConnection NewConnection()
Returns
Type |
Description |
System.Data.Common.DbConnection |
|
PingDB(UserConnection)
Declaration
public static bool PingDB(UserConnection userConnection)
Parameters
Returns
Type |
Description |
System.Boolean |
|
PingDB(UserConnection, String, String)
Declaration
public static bool PingDB(UserConnection userConnection, string userName, string password)
Parameters
Type |
Name |
Description |
UserConnection |
userConnection |
|
System.String |
userName |
|
System.String |
password |
|
Returns
Type |
Description |
System.Boolean |
|
QueryParametersToDBParameters(QueryParameterCollection, DbParameterCollection)
Declaration
protected abstract void QueryParametersToDBParameters(QueryParameterCollection queryParameters, DbParameterCollection dbParameters)
Parameters
RefreshMaterializedView(String)
Executes refresh materialized view.
Declaration
public virtual void RefreshMaterializedView(string viewName)
Parameters
Type |
Name |
Description |
System.String |
viewName |
Materialized view name.
|
Exceptions
Type |
Condition |
System.Security.SecurityException |
Thrown when viewName contains sql injections
if NeedCheckAliasInQuery is set.
|
RollbackTransaction()
Rolls back a transaction from a pending state.
Declaration
public virtual void RollbackTransaction()
SplitBatches(String)
Declaration
protected abstract IEnumerable<string> SplitBatches(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
StartTransaction()
Starts a database transaction.
Declaration
public virtual void StartTransaction()
StartTransaction(IsolationLevel)
Starts a database transaction with the specified isolation level.
Declaration
public void StartTransaction(IsolationLevel isolationLevel)
Parameters
Type |
Name |
Description |
System.Data.IsolationLevel |
isolationLevel |
The transaction isolation level.
|
ValidateBatches(DbCommand, String, out String)
Declaration
protected abstract bool ValidateBatches(DbCommand command, string sqlText, out string message)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.String |
sqlText |
|
System.String |
message |
|
Returns
Type |
Description |
System.Boolean |
|
ValidateBatches(String, out String)
Declaration
public virtual bool ValidateBatches(string sqlText, out string message)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
|
System.String |
message |
|
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IDisposable
Extension Methods
See Also