Last post May 24, 2019 05:21 AM by Yuki Tao
May 23, 2019 10:42 AM|uid836778|LINK
i am develop the MVC project, i have a some issue for this , im already to created database , but i cant update DB in add
PM> Update-Database method, displayed the following error , how can i fix it?
PM> Update-Database method
May 23, 2019 11:18 AM|AddWeb Solution|LINK
Hi, Zhang Wei
Sorry but what is your actual error..???
May 24, 2019 05:21 AM|Yuki Tao|LINK
Hi Zhang Wei,
Generally,the first step is to enable migrations for our context:
Run the Enable-Migrations command in Package Manager Console . (make sure that default project is the project where your context class is).
Add-Migration will scaffold the next migration based on changes you have made to your model since the last migration was created
Update-Database will apply any pending migrations to the database
More details about Code First Migrations,you could refer to:
In addition,you could google your error message,it should be able to find the answer.