change table name in a model

Feb 28, 2011 at 9:39 AM

Can I change the table Name property in a model once a table has already been generated in the database.

If i regenerate after the table name can been changes will this update go correctly to the database level

Same question also for column names.


Feb 28, 2011 at 3:05 PM

Yes. The change script that is generated will change the database name. ***FYI: You will need to clean up your project. Files are generated like Tablename.cs and Tablename.Generated.cs. So if you change a table name, you will need to delete these files from your generated projects. If you rename column names there is nothing to do. The change script is generated and all column names are contained the TableName.cs file so the file is re-generated and all is well.

You can change a table name in code without touching the database. If you change the table's Codefacade property, the code name will change but it will map to the original (different) database table name. This is easier if applies to your situation.