Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
654 B

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace MicroserviceDemo.Web.Db
{
/* This class is needed for EF Core command line tooling */
public class MigrationDbContextFactory : IDesignTimeDbContextFactory<MigrationDbContext>
{
public MigrationDbContext CreateDbContext(string[] args)
{
var builder = new DbContextOptionsBuilder<MigrationDbContext>();
builder.UseSqlServer("Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true");
return new MigrationDbContext(builder.Options);
}
}
}