It is possible to just set the databasetable.NetName property. This is sufficient for simple changes before code generation.
var docStatusTable = schema.FindTableByName("DocumentStatus");
docStatusTable.NetName = "DocState";
var productsTableAgain = schema.FindTableByName("DocumentStatus"); //find it again (second reference)
Console.WriteLine(docStatusTableAgain.NetName); //shows "DocState"
Changing the actual name (databasetable.Name) is more problematic, although this is only a problem for DDL generation, not code generation. The foreign key constraints may keep the old name (in the string properties- TableName) although the reference properties
will be correct. There are also references in views, stored procedures, triggers and the like- and those are way beyond the scope of this little project.
For more extensive changes, there is a mechanism via CodeWriterSettings - it has a Namer property, and you can either implement the INamer interface, or more practically override the base Namer class with customizations. The simplest is to override the Namer.Name(string)
signature. In the library, the PluralizingNamer is in fact a class that inherits from Namer and overrides it.
Removing a table should be done with the schema.RemoveTable(string) extension method.
If you just do schema.Tables.Remove(table), all the foreign key associations still point to the missing table and the code generation will probably just fail. The RemoveTable extension cleans up the foreign keys first, so the code generation will still work