Incredibly with a single command, you can create the database if it does not exist, create tables that do not exist, and add columns that do not already exist. Here is how it works:
- The setup command will pull the default database name or file path from the connection string.
- If it is a file based database, the directory will be created if it does not exist.
- The database is created if it does not already exist
- The connection is opened to the database
- The classes in the specified namespace are checked to see if they exist in the database
- Tables are created if they do not exist.
- Existing tables are checked to see if they have all the columns
- Columns are created that do not exist
//Get the current instance of the helper
IDataHelper db = DataHelper.SessionFactory();
//Create Database, Tables, and Add Columns
db.Setup("AcmeCorporation.InvoiceSystem);