Recusiwe
Recusiwe

Reputation: 898

EF Code First from database and updating the model?

I recently added a database to my ASP.net MVC project using "Create Model from existing database using Code First" and noew I've just added a new column to the database but are struggling with updating my model? How do I do that? I'm familiar with the update using the .emdx-file, but I can't seem to find one.

Thanks!

Upvotes: 1

Views: 98

Answers (2)

Tom
Tom

Reputation: 836

There is no edmx file if you used Code First, to update the db you need to use migrations or handle it manually.

Upvotes: 1

T McKeown
T McKeown

Reputation: 12857

Going from memory....

  • Dbl Click on the database .edmx file
  • Then dbl click the Model tab on the solution explorer.
  • Delete the Type from the Solution Explorer
  • Right click on the model/canvas area and select Update Model from Database.

Upvotes: 0

Related Questions