none
Problem with update model from database RRS feed

  • Question

  • Hi, 

    I have a one project asp.net mvc, i use VS2015. After delete in the sql server one entity and use the option of VS Update Model from Database the other entities desappear. All others were excluded.

    Thank you very much in advance.

    • Moved by Bob Beauchemin Wednesday, July 20, 2016 5:30 PM Moved to a more relevant forum for best results
    Wednesday, July 20, 2016 12:08 PM

Answers

  • Hi Clauber Clemente,

    According to your description, it seems that you use database first approach. you delete a table from SQL server and use Update Model from Database to update your entities. but all entities disappear, isn't it?

    I create a simple demo and use the method which the following link providing (please see '6 Click the Delete tab'). it works fine. all entities exist.

    https://msdn.microsoft.com/en-us/library/cc716697(v=vs.100).aspx

    In addition, I suggest that you could delete the EDMX file and create a new EMDX again and check if entities exist.

    For more information about EF database first approach, please refer to:

    https://msdn.microsoft.com/en-sg/data/jj206878.aspx

    Best regards,

    Cole Wu


    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.


    Thursday, July 21, 2016 5:25 AM
    Moderator

All replies

  • Maybe you should find a MVC EF tutorial that is using DB First. I am not a fan of using EF directly in the MVC controller or a Web API controller.
    Wednesday, July 20, 2016 9:55 PM
  • Hi Clauber Clemente,

    According to your description, it seems that you use database first approach. you delete a table from SQL server and use Update Model from Database to update your entities. but all entities disappear, isn't it?

    I create a simple demo and use the method which the following link providing (please see '6 Click the Delete tab'). it works fine. all entities exist.

    https://msdn.microsoft.com/en-us/library/cc716697(v=vs.100).aspx

    In addition, I suggest that you could delete the EDMX file and create a new EMDX again and check if entities exist.

    For more information about EF database first approach, please refer to:

    https://msdn.microsoft.com/en-sg/data/jj206878.aspx

    Best regards,

    Cole Wu


    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.


    Thursday, July 21, 2016 5:25 AM
    Moderator
  • Thank´s a lot Cole Wu, 

    is this at the point. It worked perfectly.

    Thursday, July 21, 2016 11:27 AM