1

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!

2
  • I used the "Code first from database" in the Entity data model wizard. Commented Jul 1, 2014 at 20:46
  • Well, the idea of code first is that you update the database from code. These "Code first from database" tools are designed to give you a jump start into code-first, not to update a code first model. If you want to work database first, create an edmx from the database. Commented Jul 2, 2014 at 15:43

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.

1 Comment

Yep, there is no to be found. I'm used to that appróach, but I can't seem to find any .edmx's.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.