Add design-time factory for DbContext

This commit is contained in:
Slendy 2023-06-20 16:17:12 -05:00
commit 0fd8759f3f
No known key found for this signature in database
GPG key ID: 7288D68361B91428

View file

@ -0,0 +1,12 @@
using Microsoft.EntityFrameworkCore.Design;
namespace LBPUnion.ProjectLighthouse.Database;
/// <summary>
/// This class is only used for the code-first migration builder to detect the DbContext
/// </summary>
// ReSharper disable once UnusedType.Global
public class DatabaseContextFactory : IDesignTimeDbContextFactory<DatabaseContext>
{
public DatabaseContext CreateDbContext(string[] args) => DatabaseContext.CreateNewInstance();
}