Updating Entity Framework Model

前端 未结 6 2186
悲&欢浪女
悲&欢浪女 2020-12-31 00:20

I have just started using EF and found it cool, but I ran into a problem,

Problem:
I changed my DB schema of a column inside the table User, It

6条回答
  •  无人及你
    2020-12-31 00:55

    No need to worry about it. Select the affected table in the model. If you observe, there you will find a new column name post fix with an integer (This behavior is only because of the change in the datatype of that column).

    Example if your column name is "Samplecolumn", after updating the model from the database you will get a new column with Samplecolumn1. You can now simply remove the old column "Samplecolumn" and rename the new column "Samplecolumn1" to "Samplecolumn" using the properties window under general category.

    Just build your app. The error will be gone.

提交回复
热议问题