Foodolini.Tools.Database< TConnection > Class Template Reference
List of all members.
Public Member Functions |
delegate T | RelationalMapperDelegate< T > (IDataReader rdr) |
bool | ExecuteNonQuery (string sql) |
| Executes an sql statement and returns if any rows were affected.
|
abstract TConnection | GetConnection () |
T | ExecuteReader< T > (string sql, RelationalMapperDelegate< T > map) |
| Returns a generic type from an sql statement.
|
void | CloseDatabase () |
IDataReader | GetReader (string sql) |
| Returns an IDataReader. Remember to close it after use.
|
IDataReader | GetReader (string sql, bool closeConnection) |
| Returns an IDataReader. Remember to close it after use.
|
object | ExecuteScalar (string sql) |
| Executes a scalar sql statement.
|
Protected Member Functions |
delegate T | QueryHandler< T > (DbCommand cmd) |
abstract DbCommand | GetCommand (string sql) |
Protected Attributes |
TConnection | connection |
| Generic DbConnection. Inheriting database classes specify the concrete DbConnection.
|
Private Member Functions |
T | OpenDatabase< T > (DbCommand cmd, QueryHandler< T > doQuery) |
| Executes a command against the database and closes the connection.
|
T | OpenDatabase< T > (DbCommand cmd, QueryHandler< T > doQuery, bool closeConnection) |
Detailed Description
template<TConnection>
class Foodolini::Tools::Database< TConnection >
- Type Constraints
-
TConnection | : | DbConnection | |
TConnection | : | new() | |
Definition at line 10 of file DB.cs.
Member Function Documentation
template<TConnection >
void Foodolini.Tools.Database< TConnection >.CloseDatabase |
( |
|
) |
|
Definition at line 77 of file DB.cs.
template<TConnection >
bool Foodolini.Tools.Database< TConnection >.ExecuteNonQuery |
( |
string |
sql |
) |
|
Executes an sql statement and returns if any rows were affected.
- Parameters:
-
- Returns:
Definition at line 25 of file DB.cs.
template<TConnection >
T Foodolini.Tools.Database< TConnection >.ExecuteReader< T > |
( |
string |
sql, |
|
|
RelationalMapperDelegate< T > |
map | |
|
) |
| | |
Returns a generic type from an sql statement.
- Template Parameters:
-
| T | A type with an empty default constructor |
- Parameters:
-
| sql | SQL statement |
| map | Mapping function |
- Returns:
template<TConnection >
object Foodolini.Tools.Database< TConnection >.ExecuteScalar |
( |
string |
sql |
) |
|
Executes a scalar sql statement.
- Parameters:
-
- Returns:
Definition at line 110 of file DB.cs.
template<TConnection >
abstract DbCommand Foodolini.Tools.Database< TConnection >.GetCommand |
( |
string |
sql |
) |
[protected, pure virtual] |
template<TConnection >
abstract TConnection Foodolini.Tools.Database< TConnection >.GetConnection |
( |
|
) |
[pure virtual] |
template<TConnection >
IDataReader Foodolini.Tools.Database< TConnection >.GetReader |
( |
string |
sql, |
|
|
bool |
closeConnection | |
|
) |
| | |
Returns an IDataReader. Remember to close it after use.
- Parameters:
-
- Returns:
Definition at line 97 of file DB.cs.
template<TConnection >
IDataReader Foodolini.Tools.Database< TConnection >.GetReader |
( |
string |
sql |
) |
|
Returns an IDataReader. Remember to close it after use.
- Parameters:
-
- Returns:
Definition at line 87 of file DB.cs.
template<TConnection >
T Foodolini.Tools.Database< TConnection >.OpenDatabase< T > |
( |
DbCommand |
cmd, |
|
|
QueryHandler< T > |
doQuery, |
|
|
bool |
closeConnection | |
|
) |
| | [private] |
template<TConnection >
T Foodolini.Tools.Database< TConnection >.OpenDatabase< T > |
( |
DbCommand |
cmd, |
|
|
QueryHandler< T > |
doQuery | |
|
) |
| | [private] |
Executes a command against the database and closes the connection.
- Template Parameters:
-
- Parameters:
-
- Returns:
template<TConnection >
delegate T Foodolini.Tools.Database< TConnection >.QueryHandler< T > |
( |
DbCommand |
cmd |
) |
[protected] |
template<TConnection >
delegate T Foodolini.Tools.Database< TConnection >.RelationalMapperDelegate< T > |
( |
IDataReader |
rdr |
) |
|
Member Data Documentation
template<TConnection >
TConnection Foodolini.Tools.Database< TConnection >.connection [protected] |
Generic DbConnection. Inheriting database classes specify the concrete DbConnection.
Definition at line 18 of file DB.cs.
The documentation for this class was generated from the following file:
- Foodolini.Tools/Import/DB.cs
Foodolini 1.0.0 Documentation, generated with DoxyGen.