I am having a few problems with updating the model in EF using Model First.

I have exhausted my efforts with the suggestions of adding migrations (which is normally done using Code First).

The Package Manager Console prints the message

Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database First or Model First is not supported. EDMX can only be obtained from a Code First DbContext created without using an existing DbCompiledModel.

I have also tried this suggestion

Updating model in EF Database First project

However nothing happens when i click "Run Custom Tool"

Any suggestions please on how to update the model to reflect the changes that have been added to the database.

有帮助吗?

解决方案

Open your model right click and you will find an option Update Model from database

enter image description here

Click update model from database than a window will open like this:

enter image description here

So choose the modified table to update them in model.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top