Files
hrynco-notification-service/HrynCo.NotificationService.DAL.EF/ServiceCollectionExtensions.cs
T
Anatolii Grynchuk ee4c988a0d refactor: replace local dal abstractions with hrynco-ef packages
Remove duplicate IEntity, Entity, ITransaction, IUnitOfWork, EfRepository,
EfUnitOfWork, EfTransactionAdapter — now consumed from HrynCo.DAL.Abstract
and HrynCo.DAL.EF packages (1.0.1).

Ref: IT-0
2026-05-05 20:39:06 +03:00

27 lines
967 B
C#

using HrynCo.DAL.Abstract;
using HrynCo.NotificationService.DAL.Abstract.Repositories;
using HrynCo.NotificationService.DAL.EF.Core;
using HrynCo.NotificationService.DAL.EF.Repositories;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace HrynCo.NotificationService.DAL.EF;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddNotificationDataAccess(
this IServiceCollection services,
string connectionString)
{
services.AddDbContext<NotificationDbContext>(options =>
options.UseNpgsql(connectionString));
services.AddScoped<IUnitOfWork, UnitOfWork>();
services.AddScoped<IEmailTemplateRepository, EmailTemplateRepository>();
services.AddScoped<IEmailChannelRepository, EmailChannelRepository>();
services.AddScoped<IEmailChannelUsageRepository, EmailChannelUsageRepository>();
return services;
}
}