C# Class Passive.DynamicDatabase

A class that wraps your database in Dynamic Funtime
Afficher le fichier Open project: Talljoe/Passive Class Usage Examples

Méthodes publiques

Méthode Description
DynamicDatabase ( ) : System

Initializes a new instance of the DynamicDatabase class.

DynamicDatabase ( DatabaseDialect dialect, string connectionStringName = "" ) : System

Initializes a new instance of the DynamicDatabase class.

DynamicDatabase ( DatabaseDialect dialect, string connectionString, string providerName ) : System

Initializes a new instance of the DynamicDatabase class.

DynamicDatabase ( string connectionStringName ) : System

Initializes a new instance of the DynamicDatabase class.

DynamicDatabase ( string connectionStringName, IEnumerable databaseDetectors ) : System

Initializes a new instance of the DynamicDatabase class.

DynamicDatabase ( string connectionString, string providerName ) : System

Initializes a new instance of the DynamicDatabase class.

DynamicDatabase ( string connectionString, string providerName, IEnumerable databaseDetectors ) : System

Initializes a new instance of the DynamicDatabase class.

Execute ( ) : int

Executes a series of DBCommands

Execute ( IEnumerable commands, bool transaction = false ) : int

Executes a series of DBCommands optionally in a transaction

Execute ( string sql ) : int

Executes a single DBCommand

ExecuteTransaction ( ) : int

Executes a series of DBCommands in a transaction

Fetch ( DynamicCommand command ) : IList

Runs a query against the database.

Fetch ( string sql ) : IList

Runs a query against the database.

GetTable ( string tableName, string primaryKeyField = "" ) : DynamicModel

Gets a table in the database.

OpenConnection ( ) : DbConnection

Returns a database connection.

Query ( DynamicCommand command ) : IEnumerable

Enumerates the reader yielding the results

Query ( string sql ) : IEnumerable

Enumerates the reader yielding the result

Scalar ( DynamicCommand command ) : object

Returns a single result

Scalar ( string sql ) : object

Returns a single result

Private Methods

Méthode Description
CreateDbCommand ( DynamicCommand command, DbTransaction tx = null, DbConnection connection = null ) : DbCommand
Initialize ( string connectionString, string providerName, IEnumerable databaseDetectors = null ) : void

Method Details

DynamicDatabase() public méthode

Initializes a new instance of the DynamicDatabase class.
public DynamicDatabase ( ) : System
Résultat System

DynamicDatabase() public méthode

Initializes a new instance of the DynamicDatabase class.
public DynamicDatabase ( DatabaseDialect dialect, string connectionStringName = "" ) : System
dialect Passive.Dialect.DatabaseDialect The dialect.
connectionStringName string Name of the connection string.
Résultat System

DynamicDatabase() public méthode

Initializes a new instance of the DynamicDatabase class.
public DynamicDatabase ( DatabaseDialect dialect, string connectionString, string providerName ) : System
dialect Passive.Dialect.DatabaseDialect The dialect.
connectionString string Database connection string
providerName string Invariant name of the database provider
Résultat System

DynamicDatabase() public méthode

Initializes a new instance of the DynamicDatabase class.
public DynamicDatabase ( string connectionStringName ) : System
connectionStringName string Name of the connection string.
Résultat System

DynamicDatabase() public méthode

Initializes a new instance of the DynamicDatabase class.
public DynamicDatabase ( string connectionStringName, IEnumerable databaseDetectors ) : System
connectionStringName string Name of the connection string.
databaseDetectors IEnumerable Classes used to probe the database.
Résultat System

DynamicDatabase() public méthode

Initializes a new instance of the DynamicDatabase class.
public DynamicDatabase ( string connectionString, string providerName ) : System
connectionString string Database connection string
providerName string Invariant name of the database provider
Résultat System

DynamicDatabase() public méthode

Initializes a new instance of the DynamicDatabase class.
public DynamicDatabase ( string connectionString, string providerName, IEnumerable databaseDetectors ) : System
connectionString string Database connection string
providerName string Invariant name of the database provider
databaseDetectors IEnumerable Classes used to probe the database.
Résultat System

Execute() public méthode

Executes a series of DBCommands
public Execute ( ) : int
Résultat int

Execute() public méthode

Executes a series of DBCommands optionally in a transaction
public Execute ( IEnumerable commands, bool transaction = false ) : int
commands IEnumerable
transaction bool
Résultat int

Execute() public méthode

Executes a single DBCommand
public Execute ( string sql ) : int
sql string
Résultat int

ExecuteTransaction() public méthode

Executes a series of DBCommands in a transaction
public ExecuteTransaction ( ) : int
Résultat int

Fetch() public méthode

Runs a query against the database.
public Fetch ( DynamicCommand command ) : IList
command DynamicCommand
Résultat IList

Fetch() public méthode

Runs a query against the database.
public Fetch ( string sql ) : IList
sql string
Résultat IList

GetTable() public méthode

Gets a table in the database.
public GetTable ( string tableName, string primaryKeyField = "" ) : DynamicModel
tableName string
primaryKeyField string
Résultat DynamicModel

OpenConnection() public méthode

Returns a database connection.
public OpenConnection ( ) : DbConnection
Résultat System.Data.Common.DbConnection

Query() public méthode

Enumerates the reader yielding the results
public Query ( DynamicCommand command ) : IEnumerable
command DynamicCommand
Résultat IEnumerable

Query() public méthode

Enumerates the reader yielding the result
public Query ( string sql ) : IEnumerable
sql string
Résultat IEnumerable

Scalar() public méthode

Returns a single result
public Scalar ( DynamicCommand command ) : object
command DynamicCommand
Résultat object

Scalar() public méthode

Returns a single result
public Scalar ( string sql ) : object
sql string
Résultat object