none
Added a new entity from "update model from database" approach then I see other entities are getting automatically updated RRS feed

  • Question

  • I am using Entity Framework 5.0 and I have created .edmx   using "Update Model from Database" approach and its working as expected. <o:p></o:p>

    In Addition to this, we have added one or two new columns to existing tables and also some constraints. ( these are only required for my another new environment)<o:p></o:p>

    Then we found another new entity to be added to the existing model and I picked that table from DB using the above approach and also I see the updates automatically to the previous entities as well, but I don’t want those “new column changes and constraints“ to be part of my EDMX file How can I restrict this feature to avail on the new entity change which I have added to the model. Could you please help us on this. <o:p></o:p>

     


    Regards Vikas Pathak

    Friday, July 11, 2014 2:18 PM

Answers

  • Hello,

    >>but I don’t want those “new column changes and constraints“ to be part of my EDMX file How can I restrict this feature to avail on the new entity change which I have added to the model.

    I feel a bit confused about your question.

    This is my understanding from your description:

    For the “new column changes”, you add some new columns to exist tables and you do not want to access them in your current project, you would access them in another new project.

    If it is, you just do not update them from database, or if you have done it, then you could delete them from the model, however, there is a restriction that these new added columns should be nullable or it could throw a database error when you want to add new data to these tables.

    For these new constraints, unfortunately, we cannot to delete them as above like deleting new added columns, in one same database, Entity Framework requires complete constraints.

    >> these are only required for my another new environment

    You might need to create a new database for your new environment since their constraints are different.

    If i misunderstand, please let me know.

    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.

    Monday, July 14, 2014 6:21 AM
    Moderator