Files
BTCPayServerPlugins/Plugins/BTCPayServer.Plugins.MicroNode/MicroNodeContextFactory.cs
2024-01-17 09:07:18 +01:00

23 lines
743 B
C#

using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Abstractions.Models;
using Laraue.EfCoreTriggers.PostgreSql.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
namespace BTCPayServer.Plugins.MicroNode;
public class MicroNodeContextFactory : BaseDbContextFactory<MicroNodeContext>
{
public MicroNodeContextFactory(IOptions<DatabaseOptions> options) : base(options, "BTCPayServer.Plugins.MicroNode")
{
}
public override MicroNodeContext CreateContext()
{
var builder = new DbContextOptionsBuilder<MicroNodeContext>();
ConfigureBuilder(builder);
builder.UsePostgreSqlTriggers();
return new MicroNodeContext(builder.Options);
}
}