How to update only one table for model from database with Entity Framework?

后端 未结 3 2039
悲哀的现实
悲哀的现实 2021-02-02 07:53

I have a model generated from db with Entity Framework. When I have any change in database, I update model from database to get the change in model. But this update is applied t

3条回答
  •  温柔的废话
    2021-02-02 08:12

    I use following (Conditional) trick. This could be done only when no Table depends on the table which you want to update.

    1. Delete the table which needs to be updated.
    2. Right click on Model and select 'Update Model From Database'. The Table would be shown in the tab 'Add'. Select this table and Update the model.

    Precaution : If other existing tables have changes in them, EF would update these changes as well.

提交回复
热议问题