Add infrastructure layer with persistence and services

- EF Core DbContext and entity configurations
- Design-time factory for migrations
- Initial and soft-delete migrations
- Service implementations: Account, AccountYear, Entry,
  BalanceQuery, FileSave, PdfStatement
- Dependency injection registration
This commit is contained in:
2026-03-31 17:12:57 +02:00
parent 8fbb8b8ea2
commit c3d68020d5
19 changed files with 1450 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using Duempelkas.App.Services;
using Duempelkas.Infrastructure.Persistence;
using Duempelkas.Infrastructure.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace Duempelkas.Infrastructure;
public static class DependencyInjection
{
public static IServiceCollection AddInfrastructure(this IServiceCollection services, string connectionString)
{
services.AddDbContext<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>();
return services;
}
}