Update model from database in entity framework is not working

c# entity-framework

Question

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?

1
4
3/13/2014 7:35:04 AM

Accepted Answer

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.

9
3/13/2014 8:09:40 AM

Popular Answer

Check if the new updated/created table in the database contains an identity key column (like an ID column). Entity Framework is especially sensitive when working with tables that don't represent uniqueness in their records.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow