Implement backup and restore functionality; add IBackupService and BackupService; refactor services to use DbContextFactory

This commit is contained in:
2026-04-03 10:53:53 +02:00
parent 0923c037eb
commit 387c18e834
15 changed files with 411 additions and 71 deletions

View File

@@ -12,12 +12,15 @@ public static class DependencyInjection
{
services.AddDbContext<FinanceDbContext>(options =>
options.UseSqlite(connectionString));
services.AddDbContextFactory<FinanceDbContext>(options =>
options.UseSqlite(connectionString));
services.AddScoped<IAccountService, AccountService>();
services.AddScoped<IEntryService, EntryService>();
services.AddScoped<IBalanceQueryService, BalanceQueryService>();
services.AddScoped<IPdfStatementService, PdfStatementService>();
services.AddScoped<IFileSaveService, FileSaveService>();
services.AddSingleton<IBackupService, BackupService>();
services.AddSingleton<ISettingsService, SettingsService>();
return services;