Interface IDataHelper
Namespace: MESL.SqlRace.Domain.Infrastructure.DataAccess
Assembly: MESL.SqlRace.Domain.dll
Syntax
public interface IDataHelper : IDisposable
Properties
Command
Gets the command.
Declaration
DbCommand Command { get; }
Property Value
Type | Description |
---|---|
System.Data.Common.DbCommand | The command. |
CommandTimeout
Gets or sets the command timeout.
Declaration
int CommandTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The command timeout. |
ConnectionTimeout
Gets the connection timeout.
Declaration
int ConnectionTimeout { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The connection timeout. |
Parameters
Gets the parameters.
Declaration
DbParameterCollection Parameters { get; }
Property Value
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The parameters. |
Methods
AddParameter(DbParameter)
Adds the parameter.
Declaration
void AddParameter(DbParameter parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameter | parameter | The parameter. |
AddParameter(String, ParameterDirection, DbType, Int32, Object)
Adds the parameter.
Declaration
DbParameter AddParameter(string parameterName, ParameterDirection direction, DbType type, int size, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Name of the parameter. |
System.Data.ParameterDirection | direction | The direction. |
System.Data.DbType | type | The type. |
System.Int32 | size | The size. |
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameter |
AddParameter(String, ParameterDirection, DbType, Object)
Adds the parameter.
Declaration
DbParameter AddParameter(string parameterName, ParameterDirection direction, DbType type, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Name of the parameter. |
System.Data.ParameterDirection | direction | The direction. |
System.Data.DbType | type | The type. |
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameter |
AddParameter(String, ParameterDirection, SqlDbType, Int32, Object)
Adds the parameter.
Declaration
DbParameter AddParameter(string parameterName, ParameterDirection direction, SqlDbType type, int size, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Name of the parameter. |
System.Data.ParameterDirection | direction | The direction. |
System.Data.SqlDbType | type | The type. |
System.Int32 | size | The size. |
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameter |
AddParameter(String, ParameterDirection, SqlDbType, Object)
Adds the parameter.
Declaration
DbParameter AddParameter(string parameterName, ParameterDirection direction, SqlDbType type, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Name of the parameter. |
System.Data.ParameterDirection | direction | The direction. |
System.Data.SqlDbType | type | The type. |
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameter |
BeginTransaction()
Begins the transaction.
Declaration
DbTransaction BeginTransaction()
Returns
Type | Description |
---|---|
System.Data.Common.DbTransaction |
BulkCopy<T>(String, ColumnMappedDataTable<T>)
Bulks the copy.
Declaration
void BulkCopy<T>(string destinationTableName, ColumnMappedDataTable<T> dataTable)
Parameters
Type | Name | Description |
---|---|---|
System.String | destinationTableName | Name of the destination table. |
ColumnMappedDataTable<T> | dataTable | The data table. |
Type Parameters
Name | Description |
---|---|
T |
CreateCommand()
Create a new command to use with this existing connection
Declaration
DbCommand CreateCommand()
Returns
Type | Description |
---|---|
System.Data.Common.DbCommand | The command associated with the connection |
ExecuteDataReader(String)
Executes the data reader.
Declaration
DbDataReader ExecuteDataReader(string storedProcedure)
Parameters
Type | Name | Description |
---|---|---|
System.String | storedProcedure | The stored procedure. |
Returns
Type | Description |
---|---|
System.Data.Common.DbDataReader |
ExecuteDataReader(String, CommandBehavior)
Executes the data reader.
Declaration
DbDataReader ExecuteDataReader(string storedProcedure, CommandBehavior behavior)
Parameters
Type | Name | Description |
---|---|---|
System.String | storedProcedure | The stored procedure. |
System.Data.CommandBehavior | behavior | The behavior. |
Returns
Type | Description |
---|---|
System.Data.Common.DbDataReader |
ExecuteDataReader(String, CommandType)
Executes the data reader.
Declaration
SqlDataReader ExecuteDataReader(string commandText, CommandType commandType)
Parameters
Type | Name | Description |
---|---|---|
System.String | commandText | The command text. |
System.Data.CommandType | commandType | Type of the command. |
Returns
Type | Description |
---|---|
System.Data.SqlClient.SqlDataReader |
ExecuteNonQuery(String)
Executes the non query.
Declaration
int ExecuteNonQuery(string storedProcedure)
Parameters
Type | Name | Description |
---|---|---|
System.String | storedProcedure | The stored procedure. |
Returns
Type | Description |
---|---|
System.Int32 |
ExecuteNonQuery(String, CommandType)
Executes the non query.
Declaration
int ExecuteNonQuery(string commandText, CommandType commandType)
Parameters
Type | Name | Description |
---|---|---|
System.String | commandText | The command text. |
System.Data.CommandType | commandType | Type of the command. |
Returns
Type | Description |
---|---|
System.Int32 |
ExecuteQuery<T>(String, Object)
Executes the query.
Declaration
IEnumerable<T> ExecuteQuery<T>(string commandText, object param)
Parameters
Type | Name | Description |
---|---|---|
System.String | commandText | The command text. |
System.Object | param | The parameter. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteQuery<T>(String, Object, Boolean)
Executes the query.
Declaration
IEnumerable<T> ExecuteQuery<T>(string commandText, object param, bool buffered)
Parameters
Type | Name | Description |
---|---|---|
System.String | commandText | The command text. |
System.Object | param | The parameter. |
System.Boolean | buffered | True if the results should be buffered and returned when the query is finished, false to begin returning immediately. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteScalar(String)
Executes the scalar.
Declaration
object ExecuteScalar(string storedProcedure)
Parameters
Type | Name | Description |
---|---|---|
System.String | storedProcedure | The stored procedure. |
Returns
Type | Description |
---|---|
System.Object |
ExecuteScalar(String, CommandType)
Executes the scalar.
Declaration
object ExecuteScalar(string commandText, CommandType commandType)
Parameters
Type | Name | Description |
---|---|---|
System.String | commandText | The command text. |
System.Data.CommandType | commandType | Type of the command. |
Returns
Type | Description |
---|---|
System.Object |
OpenConnection()
Opens the connection.
Declaration
void OpenConnection()
Reset()
Resets this instance.
Declaration
void Reset()