Show / Hide Table of Contents

Interface IDatabaseCommand

Provides an interface to send execution commands to the database. Can be either a query string, or a stored procedure name.

Namespace: Paradigm.ORM.Data.Database
Assembly: Paradigm.ORM.Data.dll
Syntax
public interface IDatabaseCommand : IDisposable

Properties

| Improve this Doc View Source

CommandText

Gets or sets the SQL statement, table name or stored procedure to execute at the data source.

Declaration
string CommandText { get; set; }
Property Value
Type Description
System.String

The SQL statement or stored procedure to execute. The default is an empty string.

| Improve this Doc View Source

CommandTimeout

Gets or sets the wait time before terminating the attempt to execute a command and generating an error.

Declaration
int CommandTimeout { get; set; }
Property Value
Type Description
System.Int32

The time in seconds to wait for the command to execute. The default is 30 seconds.

| Improve this Doc View Source

CommandType

Gets or sets a value indicating how the CommandText property is to be interpreted.

Declaration
CommandType CommandType { get; set; }
Property Value
Type Description
CommandType

One of the values. The default is Text.

| Improve this Doc View Source

Parameters

Gets the array of parameters of this command instance.

Declaration
IEnumerable<IDbDataParameter> Parameters { get; }
Property Value
Type Description
IEnumerable<IDbDataParameter>

The parameters of the SQL statement or stored procedure. The default is an empty collection.

Methods

| Improve this Doc View Source

AddParameter(IDataParameter)

Adds an existing parameter to the command.

Declaration
IDataParameter AddParameter(IDataParameter parameter)
Parameters
Type Name Description
IDataParameter parameter

Parameter to add.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType, Boolean)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type, bool isNullable)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

System.Boolean isNullable

Indicates if the parameter is nullable.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType, Byte, Byte)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type, byte precision, byte scale)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

System.Byte precision

Parameter precision.

System.Byte scale

Parameter scale.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType, Byte, Byte, Boolean)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type, byte precision, byte scale, bool isNullable)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

System.Byte precision

Parameter precision.

System.Byte scale

Parameter scale.

System.Boolean isNullable

Indicates if the parameter is nullable.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType, Int32, Boolean)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type, int size, bool isNullable)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

System.Int32 size

Parameter size.

System.Boolean isNullable

Indicates if the parameter is nullable.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType, Int64)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type, long size)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

System.Int64 size

Parameter size.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType, Int64, Byte, Byte)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type, long size, byte precision, byte scale)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

System.Int64 size

Parameter size.

System.Byte precision

Parameter precision.

System.Byte scale

Parameter scale.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, DbType, Int64, Byte, Byte, Boolean)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, DbType type, long size, byte precision, byte scale, bool isNullable)
Parameters
Type Name Description
System.String name

Parameter name.

DbType type

Parameter type.

System.Int64 size

Parameter size.

System.Byte precision

Parameter precision.

System.Byte scale

Parameter scale.

System.Boolean isNullable

Indicates if the parameter is nullable.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, Type)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, Type type)
Parameters
Type Name Description
System.String name

Parameter name.

Type type

Parameter type.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, Type, Byte, Byte)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, Type type, byte precision, byte scale)
Parameters
Type Name Description
System.String name

Parameter name.

Type type

Parameter type.

System.Byte precision

Parameter precision.

System.Byte scale

Parameter scale.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, Type, Int64)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, Type type, long size)
Parameters
Type Name Description
System.String name

Parameter name.

Type type

Parameter type.

System.Int64 size

Parameter size.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

AddParameter(String, Type, Int64, Byte, Byte)

Adds a new parameter to the command.

Declaration
IDataParameter AddParameter(string name, Type type, long size, byte precision, byte scale)
Parameters
Type Name Description
System.String name

Parameter name.

Type type

Parameter type.

System.Int64 size

Parameter size.

System.Byte precision

Parameter precision.

System.Byte scale

Parameter scale.

Returns
Type Description
IDataParameter

The reference of the parameter recently added.

| Improve this Doc View Source

ClearParameters()

Clears the parameters.

Declaration
void ClearParameters()
| Improve this Doc View Source

ExecuteNonQuery()

Executes a SQL statement against the connection and returns the number of rows affected.

Declaration
int ExecuteNonQuery()
Returns
Type Description
System.Int32

The number of rows affected.

| Improve this Doc View Source

ExecuteNonQueryAsync()

Executes a SQL statement against the connection and returns the number of rows affected.

Declaration
Task<int> ExecuteNonQueryAsync()
Returns
Type Description
Task<System.Int32>

The number of rows affected.

| Improve this Doc View Source

ExecuteReader()

Sends the CommandText to the IDatabaseConnector and builds a IDatabaseReader.

Declaration
IDatabaseReader ExecuteReader()
Returns
Type Description
IDatabaseReader

A database reader object.

| Improve this Doc View Source

ExecuteReaderAsync()

Sends the CommandText to the IDatabaseConnector and builds a IDatabaseReader.

Declaration
Task<IDatabaseReader> ExecuteReaderAsync()
Returns
Type Description
Task<IDatabaseReader>

A database reader object.

| Improve this Doc View Source

ExecuteScalar()

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.

Declaration
object ExecuteScalar()
Returns
Type Description
System.Object

The first column of the first row in the result set, or a null reference if the result set is empty.

| Improve this Doc View Source

ExecuteScalarAsync()

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.

Declaration
Task<object> ExecuteScalarAsync()
Returns
Type Description
Task<System.Object>

The first column of the first row in the result set, or a null reference if the result set is empty.

| Improve this Doc View Source

GetParameter(Int32)

Gets a parameter by index.

Declaration
IDataParameter GetParameter(int index)
Parameters
Type Name Description
System.Int32 index

Parameter index.

Returns
Type Description
IDataParameter

The reference of the parameter.

| Improve this Doc View Source

GetParameter(String)

Gets a parameter by name.

Declaration
IDataParameter GetParameter(string name)
Parameters
Type Name Description
System.String name

Parameter name.

Returns
Type Description
IDataParameter

The reference of the parameter.

Extension Methods

ObjectExtensions.ThrowIfFails<TException>(Object, Action, String)
ObjectExtensions.ThrowIfFails<TException, TResult>(Object, Func<TResult>, String)
ObjectExtensions.ThrowIfFailsAsync<TException>(Object, Func<Task>, String)
ObjectExtensions.ThrowIfFailsAsync<TException, TResult>(Object, Func<Task<TResult>>, String)
  • Improve this Doc
  • View Source
Powered by MiracleDevs ©2017. Code licensed under the MIT License.
Documentation generated by DocFX.