How to re-create database for Entity Framework?

后端 未结 7 1185
野趣味
野趣味 2020-11-30 16:18

I have got into a bad state with my ASP.Net MVC 5 project, using Code-First Entity Framework. I don\'t care about losing data, I just want to be able to start fresh, recreat

7条回答
  •  我在风中等你
    2020-11-30 17:04

    This worked for me:

    1. Delete database from SQL Server Object Explorer in Visual Studio. Right-click and select delete.
    2. Delete mdf and ldf files from file system - if they are still there.
    3. Rebuild Solution.
    4. Start Application - database will be re-created.

提交回复
热议问题