Code First的Enabling Migrations
如果採 Code First 的開發方式,中途若追加欄位或異動資料庫,則會拋出例外錯誤訊息 : ”The model backing the 'XXXContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).” 這時可以參考如下的部落格文章,建立並更新遷移檔,保持最新的資料結構版本。 Entity Framework - 使用Code First的Enabling Migrations ASP.NET Identity 搭配 Entity Framework 啟用 Code First Migration