錯誤消息:
The model backing the '***' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
錯誤原因:
(1)資料模型發生改變,而沒有更新到資料庫導緻此問題。
事實上我遇到的情況不是原因(1),而是(2)造成的
(2)更新到資料庫 用的EF 6.1.0 ,而資料通路層用的是EF 6.0.2
解決方法:
(1)用Code First 更新資料庫,指令如下:
Add-Migration
Update-Database -Verbose
(2)資料通路層換成EF 6.1.0 ,問題解決