1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-10-30 05:42:47 +01:00
Minecraft-Phantom-Panel/Server/Phantom.Server.Database.Postgres/ApplicationDbContextDesignFactory.cs

16 lines
584 B
C#

using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace Phantom.Server.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);
}
}