2026-02-02 04:47:32 -06:00
|
|
|
namespace FiscalOS.Infra.Data;
|
2026-02-01 06:13:08 -06:00
|
|
|
|
2026-02-02 04:47:32 -06:00
|
|
|
public sealed record AppDbContextOptions
|
2026-02-01 06:13:08 -06:00
|
|
|
{
|
|
|
|
|
public string DatabaseFilePath { get; init; } = string.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-02 04:47:32 -06:00
|
|
|
public sealed record AppDbContextOptionsSetup : IConfigureOptions<AppDbContextOptions>
|
2026-02-01 06:13:08 -06:00
|
|
|
{
|
|
|
|
|
private const string SectionName = nameof(AppDbContextOptions);
|
|
|
|
|
private readonly IConfiguration _configuration;
|
|
|
|
|
|
|
|
|
|
public AppDbContextOptionsSetup(IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
_configuration = configuration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Configure(AppDbContextOptions options)
|
|
|
|
|
{
|
|
|
|
|
_configuration.GetSection(SectionName).Bind(options);
|
|
|
|
|
}
|
|
|
|
|
}
|