C# Class Adf.Data.DatabaseQueryHandler

Repesents a service handler that is dependent to the use of RowState for database tranaction. Provides the actual database handling for Select, Delete, Insert and Update data.
Inheritance: IAdfQueryHandler
Show file Open project: NLADP/ADF

Public Methods

Method Description
Delete ( IAdfQuery query ) : int
New ( IAdfQuery query ) : IInternalState

Create a new data row of IInternalState to insert new data into database.

Run ( IAdfQuery query ) : IInternalState

Executes a specified IAdfQuery statement and returns the affected row of data.

RunAndSplit ( IAdfQuery query ) : IEnumerable

Executes the specified query and return the result, where each row in the result is stored in an instance of IInternalState.

RunScalar ( IAdfQuery query ) : object

Executes the IAdfQuery, and returns the first column of the first row in the resultset returned by the IAdfQuery. Extra columns or rows are ignored.

Save ( IAdfQuery query, IInternalState data ) : bool

Save the specified data of IInternalState into database.

Protected Methods

Method Description
IsResultEmpty ( DataSet set ) : bool

Private Methods

Method Description
RunQuery ( IAdfQuery query ) : DataSet

Runs the specified IAdfQuery and get the executed result set into a System.Data.DataSet.

Method Details

Delete() public method

public Delete ( IAdfQuery query ) : int
query IAdfQuery
return int

IsResultEmpty() protected method

protected IsResultEmpty ( DataSet set ) : bool
set System.Data.DataSet
return bool

New() public method

Create a new data row of IInternalState to insert new data into database.
public New ( IAdfQuery query ) : IInternalState
query IAdfQuery The that defines the datasource name and query statement.
return IInternalState

Run() public method

Executes a specified IAdfQuery statement and returns the affected row of data.
public Run ( IAdfQuery query ) : IInternalState
query IAdfQuery The that defines the datasource name and query statement.
return IInternalState

RunAndSplit() public method

Executes the specified query and return the result, where each row in the result is stored in an instance of IInternalState.
public RunAndSplit ( IAdfQuery query ) : IEnumerable
query IAdfQuery The that defines the datasource name and query statement.
return IEnumerable

RunScalar() public method

Executes the IAdfQuery, and returns the first column of the first row in the resultset returned by the IAdfQuery. Extra columns or rows are ignored.
The current state of the connection is closed.
public RunScalar ( IAdfQuery query ) : object
query IAdfQuery The that defines the datasource name and query statement.
return object

Save() public method

Save the specified data of IInternalState into database.
The current state of the connection is closed. An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected.
public Save ( IAdfQuery query, IInternalState data ) : bool
query IAdfQuery The that defines the datasource name and query statement.
data IInternalState The data of that needs to be saved.
return bool