locked
Using EF with changeable database (oracle) RRS feed

  • Question

  • Hi,

    Our clients have tools to change database schema..add columns change column type etc...

    There is a way to use EF in that scenario?

    I know about code first approach and that if i add column to a table in the edmx schema i can run update data base and the changes will reflect in the data base.

    i'm looking for the opposite way if a user change a column in the data base how and where can i run a EF command to update the edmx in a specific project...

    and if there is already a better solution for this purpose i will be happy to know.

    Thanks a lot!

    Israel

    Monday, February 23, 2015 10:06 AM

Answers

  • Hello ItzCS,

    >> now, in this point i want to update the edmx file that located in a known location .

    You could open the .edmx file with notepad and then modify it, this approach does not need the Visual Studio box, however, this way is not recommended because manual modifies could make mistake sometimes.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Friday, March 6, 2015 7:05 AM
    Tuesday, March 3, 2015 7:49 AM

All replies

  • Hello ltzCS,

    From your description, it seems that you are using database first approach, if so, I am not sure if you debug these project, if you could, after the database schema is changed, you could update the emdx by the Entity Framework designer model:

    How to: Update an .edmx File when the Database Changes (Entity Data Model Tools) 

    Regards.

    Tuesday, February 24, 2015 2:22 AM
  • Thanks!

    but i'm looking for a way to update the edmx file out of the project.

    our clients have tools to change the data base (add coloumn for example)

    now, in this point i want to update the edmx file that located in a known location .

    this way the next time the client will run the application the edmx will be already updated.

    Tuesday, February 24, 2015 2:50 PM
  • You ask too much of an ORM.
    Thursday, February 26, 2015 2:49 PM
  • Hello ItzCS,

    >> now, in this point i want to update the edmx file that located in a known location .

    You could open the .edmx file with notepad and then modify it, this approach does not need the Visual Studio box, however, this way is not recommended because manual modifies could make mistake sometimes.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Friday, March 6, 2015 7:05 AM
    Tuesday, March 3, 2015 7:49 AM