Exemplo n.º 1
0
 /// <summary>
 /// Creates a database table using the provided class model.
 /// </summary>
 public void CreateTable <T>(string TableName)
 {
     if (ReuseSingleConnection)
     {
         lock (ActiveConnection)
         {
             using (MySqlCommand Command = CommandBuilder.BuildCreateTableCommand <T>(TableName, ActiveConnection))
             {
                 Command.ExecuteNonQuery();
             }
         }
     }
     else
     {
         using (MySqlConnection Connection = GetConnection(autoOpen: true, forceNew: true))
         {
             using (MySqlCommand Command = CommandBuilder.BuildCreateTableCommand <T>(TableName, Connection))
             {
                 Command.ExecuteNonQuery();
             }
         }
     }
 }