Model backing a DB Context has changed; Consider Code First Migrations

前端 未结 13 626
旧巷少年郎
旧巷少年郎 2020-12-02 09:54

The model backing the \'MyDbContext\' context has changed since the database was created. Consider using Code First Migrations to update the database (http://

13条回答
  •  感动是毒
    2020-12-02 10:12

    If you have changed the model and database with tables that already exist, and you receive the error "Model backing a DB Context has changed; Consider Code First Migrations" you should:

    • Delete the files under "Migration" folder in your project
    • Open Package Manager console and run pm>update-database -Verbose

提交回复
热议问题