2020-11-17 13:46:23 +01:00
|
|
|
using BTCPayServer.Abstractions.Contracts;
|
|
|
|
using BTCPayServer.Abstractions.Models;
|
2020-06-28 10:55:27 +02:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2021-01-06 15:51:13 +01:00
|
|
|
using Microsoft.Extensions.Options;
|
2017-09-13 08:47:34 +02:00
|
|
|
|
|
|
|
namespace BTCPayServer.Data
|
|
|
|
{
|
2020-11-17 13:46:23 +01:00
|
|
|
public class ApplicationDbContextFactory : BaseDbContextFactory<ApplicationDbContext>
|
2017-10-27 10:53:04 +02:00
|
|
|
{
|
2021-01-06 15:51:13 +01:00
|
|
|
public ApplicationDbContextFactory(IOptions<DatabaseOptions> options) : base(options, "")
|
2018-07-19 12:31:17 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-11-17 13:46:23 +01:00
|
|
|
public override ApplicationDbContext CreateContext()
|
2017-10-27 10:53:04 +02:00
|
|
|
{
|
|
|
|
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
|
|
|
|
ConfigureBuilder(builder);
|
|
|
|
return new ApplicationDbContext(builder.Options);
|
|
|
|
}
|
|
|
|
}
|
2017-09-13 08:47:34 +02:00
|
|
|
}
|