/// <summary> /// Generate the CREATE TABLE statement for the current Thing Class /// </summary> /// <returns>Thq SQL Create query</returns> public string GenerateCreateSQL() { if (_createThingQuery == null) { AttributesExtractor <IThing> attributes = new AttributesExtractor <IThing>(this); MysqlBuilder.MysqlCommandBuilder builder = new MysqlBuilder.MysqlCommandBuilder(GetType().Name); _createThingQuery = builder.BuildCreate(attributes.PropertiesWithAttributes()); } return(_createThingQuery); }
/// <summary> /// Initialize with conection /// </summary> /// <param name="con">the ODBC connection</param> public Shelf(OdbcConnection con) { TableName = typeof(T).Name; Connection = con; MySqlBuilder = new MysqlBuilder.MysqlCommandBuilder(TableName); }