26 lines
949 B
C#
26 lines
949 B
C#
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>();
|
|
services.AddSingleton<ISettingsService, SettingsService>();
|
|
|
|
return services;
|
|
}
|
|
}
|