1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-11-24 22:42:53 +01:00
Minecraft-Phantom-Panel/Controller/Phantom.Controller.Database.Postgres/ApplicationDbContextDesignFactory.cs

16 lines
588 B
C#

using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace Phantom.Controller.Database.Postgres;
public sealed class ApplicationDbContextDesignFactory : IDesignTimeDbContextFactory<ApplicationDbContext> {
public ApplicationDbContext CreateDbContext(string[] args) {
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
.UseNpgsql(static options => options.MigrationsAssembly(Assembly.GetExecutingAssembly().FullName))
.Options;
return new ApplicationDbContext(options);
}
}