0

Basically these lines are used for Data Migration in SQL Server But i want to Migrate in PostgreSQL. So please help me. Thank You.

using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())
{
    var context = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
    context.Database.EnsureCreated();
}
Jackdaw
  • 7,626
  • 5
  • 15
  • 33

1 Answers1

0

Try this.

 Enable-Migrations -ProjectName MyContextProjectNameHere -StartUpProjectName MyStartUpProjectNameHere -Verbose
  • Nice one! A reference would be nice in such cases; So that other users can get some help is case of slight different scenarios. – Mehdi Jan 07 '21 at 16:09
  • Thanx you can find the similar solution in https://stackoverflow.com/questions/18126711/enable-migrations-with-context-in-separate-assembly please do check this might help you – Saqib Khan Jan 08 '21 at 06:25