Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to re-name a column in edmx?

I am using entity framework 4.0 my approach is Database first approach. what is the best way to rename a column name or change the data type of column in edmx.

thanks in advance.

like image 604
sumanth Avatar asked Mar 24 '23 23:03

sumanth


1 Answers

To rename a column:

  1. Rename the column in SQL Management Studio.
  2. In the EDMX editor, choose "Update from Database", and complete the wizard. You will get a new column with the updated name, and an error-message saying that the old column is not mapped.
  3. Remove the old column.

To change the datatype:

  1. Update the datatype in SQL Management Studio.
  2. In the EDMX editor, choose "Update from Database", and complete the wizard. You will get an error message saying that the mapping is invalid.
  3. Change the datatype of the column to match what you chose in SQL Management Studio.
like image 158
Markus Jarderot Avatar answered Mar 29 '23 23:03

Markus Jarderot