7

Now I'm using EF 6 database first in my solution , I have entities that pre-defined in the database. I now need to update the database and add tables !

I can't find the true way to follow

Jonny C
  • 1,943
  • 3
  • 20
  • 36
Med MANS
  • 199
  • 1
  • 2
  • 13

2 Answers2

11

Open the edmx file and on a black space right click and use Update Model From Database...

enter image description here

Hossein Narimani Rad
  • 31,361
  • 18
  • 86
  • 116
  • using this solution , i must create the database table at the end-user with SQL Syntax i think ! have you other way to get migrations ? – Med MANS Jun 05 '15 at 10:05
  • @MedMANS As you said you are trying database first, I thought the table already exist. In this case I think you may want to try making the table here in the model (edmx file) and try using Generate Database from Model. – Hossein Narimani Rad Jun 05 '15 at 10:07
1

This is an alternative and the result is also much cleaner imo, you can also delete the .edmx file completely and remove the database connection string from you projects .config file. Then repeat the process of adding a new edmx file.

Bhargav
  • 8,118
  • 6
  • 40
  • 63