Code First Migrations

Code First Migrations

Code First Migrations

When Code First change the Field , then InvalidOperationException.

 

1. View  > Other Windows  > Package Manager Console

2. type >  Enable-Migrations

3.type  >  Add-Migration AddField

4. type  > Update-Database

 

參考網址: 天空