using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; namespace DeepDrftWeb.Data; public static class DeepDrftContextFactory { public class Factory : IDesignTimeDbContextFactory { public DeepDrftContext CreateDbContext(string[] args) { var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true) .Build(); var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlite(configuration.GetConnectionString("DefaultConnection")); return new DeepDrftContext(optionsBuilder.Options); } } }