mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 18:18:39 +00:00
Add design-time factory for DbContext
This commit is contained in:
parent
ab98da42c3
commit
0fd8759f3f
1 changed files with 12 additions and 0 deletions
12
ProjectLighthouse/Database/DatabaseContextFactory.cs
Normal file
12
ProjectLighthouse/Database/DatabaseContextFactory.cs
Normal 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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue