Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update model from database in entity framework is not working

If any changes have made on the datatype or constraints(e.g. not null - null) of a particular column in table and performing Update model from database (Refresh a particular table) in entity framework is not updating the entity model.

Each time I have to delete and re-create the table manually.

Is this only solution? or any other best way to do this?

like image 345
Raja Rajendraprasath Avatar asked Dec 26 '22 12:12

Raja Rajendraprasath


1 Answers

delete the applicable table(s) from your model, than select Update model from database, EF usually only checks for new fields, not changes to existing fields.

like image 176
Jason Loki Smith Avatar answered Feb 21 '23 20:02

Jason Loki Smith