Knight Data Access Layer
Generate Namespace SQL
Basic Tasks C# > Generation > Generate Namespace SQL

 Use the GenerateNamespaceSql to create the SQL needed to create the tables for all the corresponding classes in a database.

 

//Get the current instance of the helper

IDataHelper db = DataHelper.SessionFactory();

 

//Get the SQL to create tables for a namespace

string sql = db.GenerateNamespaceSql("AcmeCorporation.InvoiceSystem);