Unnesting the Blazor and moving the database to root

This commit is contained in:
2025-08-30 22:14:46 -04:00
parent 91ab145b85
commit 77856cbe26
31 changed files with 5 additions and 55 deletions
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace DeepDrftWeb.Data;
public static class DeepDrftContextFactory
{
public class Factory : IDesignTimeDbContextFactory<DeepDrftContext>
{
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<DeepDrftContext>();
optionsBuilder.UseSqlite(configuration.GetConnectionString("DefaultConnection"));
return new DeepDrftContext(optionsBuilder.Options);
}
}
}