Nishan
Nishan

Reputation: 157

Entity Framework: Reflecting table rename action

Is it possible to reflect a database table name change in an .edmx file by simply using the XML Editor? I was hoping that making this change in the EntitySet node would be sufficient, but it seems not.

Receive a "error 0040: <> type is not defined in namespace <>" message.

This is purely a database table name change with no structural changes to the table and we are using POCO objects with EF.

Thanks in advance.

Upvotes: 1

Views: 6231

Answers (2)

Nishan
Nishan

Reputation: 157

It seems that we can do this through the XML Editor; given that we are just doing a table rename and not changing the structure of the table in itself.

In our case it makes sense as the original database was not pluralizing the table so we just had to add a 's' or an 'es' in most cases; so we did not have to make any changes to the conceptual model.

Under the --> change the Table attribute to your new table name.

Ref: Change db table name in EF4 (entity framework 4)

Upvotes: 1

CodingGorilla
CodingGorilla

Reputation: 19872

Yes, it's possible but very very messy.

You need to change the SSDL as well as the CSDL.

Upvotes: 1

Related Questions