none
Missing edmx file RRS feed

  • Question

  • Hi to all

    I just followed the advice of the following link.  I should say that everything works fine, but I do not have an edmx file!!

    I ask for this, because I wanted to update my model after making changes to the db, but don't know how if the edmx file is missing.

    Thanks to all

    PS

    I should say that much rather, my files are those that are present in the following link.  They too don't have an edmx file.  When is the edmx file created?


    MarcinMR


    • Edited by MarcinMR Monday, February 22, 2016 9:13 PM
    Monday, February 22, 2016 9:11 PM

Answers

  • Hi MarcinMR,

    >>how can you update your model if you don't have an edmx file and your database changed?

    According to your description, it seems that you update your model with code first approach. If so, I would suggest that you could create model or update you model on your project, and then use migrations command to update your database.

    For more information, please refer to following link.

    https://msdn.microsoft.com/en-us/data/dn579398.aspx

    Best regards,

    Cole Wu


    Tuesday, February 23, 2016 1:57 AM
    Moderator
  • Hi MarcinMR,

    >>ie. if I create a new table in server 2014 management studio how can I import these changes to my visual studio project once the project and model already exist?

    Code first approach, you could delete all model files and context file, and then create model again. If you prefer to change the database first, and then update model from database, I would suggest you use database first approach which is easy to achieve what you want. For more information about database first, please refer to the following link.

    https://msdn.microsoft.com/en-us/data/jj206878

    Best regards,

    Cole Wu

    Tuesday, February 23, 2016 4:28 AM
    Moderator

All replies

  • Well, I figured out why my edmx file was missing.  When adding the data model, if you choose "Code First from database" no edmx file gets created.  If you choose "EF Designer from database" it creates the edmx file.  So now the question is, how can you update your model if you don't have an edmx file and your database changed?

    MarcinMR

    Monday, February 22, 2016 9:56 PM
  • Hi MarcinMR,

    >>how can you update your model if you don't have an edmx file and your database changed?

    According to your description, it seems that you update your model with code first approach. If so, I would suggest that you could create model or update you model on your project, and then use migrations command to update your database.

    For more information, please refer to following link.

    https://msdn.microsoft.com/en-us/data/dn579398.aspx

    Best regards,

    Cole Wu


    Tuesday, February 23, 2016 1:57 AM
    Moderator
  • Yes, how can I update my model in my project (blog.cs, post.cs for example) after I change my database in Server 2014 Management Studio for example?

    ie. if I create a new table in server 2014 management studio how can I import these changes to my visual studio project once the project and model already exist?

     

    MarcinMR

    Tuesday, February 23, 2016 2:02 AM
  • Hi MarcinMR,

    >>ie. if I create a new table in server 2014 management studio how can I import these changes to my visual studio project once the project and model already exist?

    Code first approach, you could delete all model files and context file, and then create model again. If you prefer to change the database first, and then update model from database, I would suggest you use database first approach which is easy to achieve what you want. For more information about database first, please refer to the following link.

    https://msdn.microsoft.com/en-us/data/jj206878

    Best regards,

    Cole Wu

    Tuesday, February 23, 2016 4:28 AM
    Moderator