I use EF core in My project and I want migrate my context using Programming (not command) So I use these two concpets one by one
1.
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
{
var context = serviceScope.ServiceProvider.GetService<UserInformationContext>();
context.Database.Migrate();
}
2.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, UserInformationContext userContext)
{
userContext.Database.Migrate();
}
Problem Is ,using this two concepts can not create any Migration Folder like add-migration command Is there any way to Create Migration Folder and Migrate Context using Programming ??