DataAccess Class
Namespace: DotNetMigrations.Core.Data
Access: Public
Overview:
The purpose of the Data Access class is to provide a simple way of handling the following items:
- Locating the connection string
- Instantiating the correct Database provider to use
- Executing commands against the database
Public Methods:
Method Name | Purpose | Notes |
GetConnectionString | Retrieves the connection from the configuration file. | A connection string passed into the method will override that found in the configuration file. |
ExecuteScalar | Executes a command against a provided database that returns a single value. | Overloaded methods allow for the value to be returned of the type specified via a generic or to suppress error messages |
ExecuteNonQuery | Executes a commands against a provided database that returns no value. | |