Andy
Andy

Reputation: 2762

What's the easiest way to refresh Entity Model after adding/deleting DB fields?

Does anyone know what the esiest way to update the entity model after adding/deleting the fields in the database?

I am adding a few new fields to my database, then choose "Update Model from DB" and nothing happens. The model stays intact. Did anyone encounter the same problem?

Thanks for any feedback!

Upvotes: 1

Views: 1466

Answers (2)

BlueSam
BlueSam

Reputation: 1888

I would definitely check out the EDM Generator which allows you to do a full generation of the model from scratch - Click here to go to the MSDN reference. It has saved me a lot of time and hope it will do the same for you.

Upvotes: 1

mhenrixon
mhenrixon

Reputation: 6278

With EF that shipped for .net 3.5 I tend to follow the following steps:

  1. Delete the connectionstring
  2. Delete the model
  3. Generate a new model
  4. Build solution

This is perhaps not a very solid approach but it saves me time in the long run. In the future it is easier and more stable to do a refresh but I have gone from autogenerating my model to model-first.

Upvotes: 1

Related Questions