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

后端 未结 1 1616
闹比i
闹比i 2021-01-21 08:30

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

相关标签:
1条回答
  • 2021-01-21 09:11

    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.
    0 讨论(0)
提交回复
热议问题