mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
26 lines
839 B
C#
26 lines
839 B
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Threading.Tasks;
|
|
using BTCPayServer.Abstractions.Contracts;
|
|
using BTCPayServer.Abstractions.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class ApplicationDbContextFactory : BaseDbContextFactory<ApplicationDbContext>
|
|
{
|
|
public ApplicationDbContextFactory(IOptions<DatabaseOptions> options) : base(options, "")
|
|
{
|
|
}
|
|
|
|
public override ApplicationDbContext CreateContext()
|
|
{
|
|
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
|
|
builder.AddInterceptors(Data.InvoiceData.MigrationInterceptor.Instance);
|
|
ConfigureBuilder(builder);
|
|
return new ApplicationDbContext(builder.Options);
|
|
}
|
|
}
|
|
}
|