mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
58d01738ab
* More Options refactoring Continues refactoring config classes to use the propert Options pattern where possible. DataDirectories and DatabaseOptions are now configured the Options pattern and the BTCPayOptions is now moved alongside the other config setup * Move COnfigure logic for Options to the Startup
22 lines
671 B
C#
22 lines
671 B
C#
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>();
|
|
ConfigureBuilder(builder);
|
|
return new ApplicationDbContext(builder.Options);
|
|
}
|
|
}
|
|
}
|