sync public allowlist from private myoffice

This commit is contained in:
myoffice-sync
2026-08-05 10:36:17 +00:00
parent 6f7fd61ee9
commit 874796c860
720 changed files with 2841 additions and 69563 deletions
@@ -1,33 +0,0 @@
namespace MyOffice.Web.Infrastructure;
using DbContext;
/// <summary>
/// Runs EF migrate + seed on startup with a scoped DbContext.
/// </summary>
public sealed class DatabaseInitializerHostedService : IHostedService
{
private readonly IServiceProvider _serviceProvider;
private readonly ILogger<DatabaseInitializerHostedService> _logger;
public DatabaseInitializerHostedService(
IServiceProvider serviceProvider,
ILogger<DatabaseInitializerHostedService> logger
)
{
_serviceProvider = serviceProvider;
_logger = logger;
}
public async Task StartAsync(CancellationToken cancellationToken)
{
await using var scope = _serviceProvider.CreateAsyncScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
_logger.LogInformation("Applying database migrations and seed data…");
await DatabaseBootstrapper.InitializeAsync(db, cancellationToken);
_logger.LogInformation("Database ready.");
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}