简体   繁体   中英

Update model from database in entity framework is not working

If any changes have made on the datatype or constraints(eg 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?

model删除适用的表,而不是选择Update model from database ,EF通常只检查新字段,而不是更改现有字段。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM