Reputation: 24706
I'm using LINQ to SQL to connect to my database and mapping tables to object.
Now I'd like to change the name of a table in my DB, but replacing it in my dbml
file I also have to replace the new name in so many places in my application that... uhmmm
So I'm wondering - Is it possible to change the name of a table in database and automatically reflect the changes in code? Is there any refactor utility to obtain this?
Upvotes: 0
Views: 965
Reputation: 109253
I don't know how you would imagine this to work. I can't really. Suppose you'd rename table Product
to let's say Produce
. How would an automated tool know that the table is renamed and not deleted while a new table happens to have been added?
If you want to rename a database table and keep it mapped to a class having its previous name, the only thing you can do (that I know of) is change the table name in the dbml file:
Upvotes: 1