Deck list work

This commit is contained in:
gamer147
2026-05-23 19:57:34 -04:00
parent 66184b3685
commit d3b2970e11
41 changed files with 70683 additions and 81 deletions

View File

@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Logging.Abstractions;
using SVSim.Database;
namespace SVSim.Bootstrap;
/// <summary>
/// Lets `dotnet ef migrations add` instantiate SVSimDbContext at design time. The runtime ctor
/// takes an ILogger which EF's tooling can't resolve without DI; this factory bypasses that.
/// Connection string here only needs to be valid Npgsql syntax — EF doesn't actually connect
/// during migration scaffolding.
/// </summary>
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<SVSimDbContext>
{
public SVSimDbContext CreateDbContext(string[] args)
{
var options = new DbContextOptionsBuilder<SVSimDbContext>()
.UseNpgsql("Host=localhost;Database=svsim;Username=postgres;password=postgres")
.Options;
return new SVSimDbContext(NullLogger<SVSimDbContext>.Instance, options);
}
}