0

I am using ef core along with web api 2 and i want to do automatic migrations and dont want to run any commands manually.

I have followed this migration

and want to use the following code during application startup to fix my issue

 System.Data.Entity.Database.SetInitializer(new MigrateDatabaseToLatestVersion<MyDbContext, Configuration>());

But Database class is from entity framework. I dont want to use entity framework because i am already using ef core. Is there any other way of doing the same?

Community
  • 1
  • 1
user1188867
  • 3,726
  • 5
  • 43
  • 69

1 Answers1

1

You can do this:

context.Database.Migrate();
ErikEJ
  • 40,951
  • 5
  • 75
  • 115