using System.Reflection; using BTCPayServer.Abstractions.Contracts; using BTCPayServer.Abstractions.Models; using BTCPayServer.Plugins.Test.Migrations; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; namespace BTCPayServer.Plugins.Test { public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory { public TestPluginDbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder(); builder.UseSqlite("Data Source=temp.db"); return new TestPluginDbContext(builder.Options, true); } } public class TestPluginDbContextFactory : BaseDbContextFactory { public TestPluginDbContextFactory(DatabaseOptions options) : base(options, "BTCPayServer.Plugins.Test") { } public override TestPluginDbContext CreateContext() { var builder = new DbContextOptionsBuilder(); ConfigureBuilder(builder); return new TestPluginDbContext(builder.Options); } } }