Refactoring ApplicationDbContext to order tables and OnModelCreating calls

This commit is contained in:
rockstardev
2020-12-28 16:32:15 -06:00
parent c9dc60be7b
commit a656f86003
2 changed files with 48 additions and 38 deletions

View File

@@ -0,0 +1,20 @@
using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Abstractions.Models;
using Microsoft.EntityFrameworkCore;
namespace BTCPayServer.Data
{
public class ApplicationDbContextFactory : BaseDbContextFactory<ApplicationDbContext>
{
public ApplicationDbContextFactory(DatabaseOptions options) : base(options, "")
{
}
public override ApplicationDbContext CreateContext()
{
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
ConfigureBuilder(builder);
return new ApplicationDbContext(builder.Options);
}
}
}