Reputation: 4124
how can I re-create database every time when I run application or if any changes has been changed?
Should I use some method in dbcontext or in Startup.cs class?
I'm using asp.net core
Upvotes: 1
Views: 151
Reputation: 41759
You can use this while testing/developing:
dbContext.Database.EnsureDeleted();
dbContext.Database.EnsureCreated();
Upvotes: 1