Files
hrynco-notification-service/HrynCo.NotificationService.DAL.EF/ServiceCollectionExtensions.cs
T
agrynco aba4173827 feat(templates): add localized push templates and actions
Share template keys across email and push with independent editors and revisions. Render localized actions and preserve version-one delivery.

Ref: IT-1627
2026-10-31 09:38:05 +02:00

33 lines
1.5 KiB
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<TemplateMutationRunner>();
services.AddScoped<HrynCo.NotificationService.DAL.Abstract.PushChannels.IPushChannelRepository, PushChannelRepository>();
services.AddScoped<HrynCo.NotificationService.DAL.Abstract.Push.IPushDeliveryRepository, PushDeliveryRepository>();
services.AddScoped<INotificationServiceRepository, NotificationServiceRepository>();
services.AddScoped<IPushTemplateDefinitionRepository, PushTemplateDefinitionRepository>();
services.AddScoped<IEmailTemplateRepository, EmailTemplateRepository>();
services.AddScoped<IEmailTemplateDefinitionRepository, EmailTemplateRepository>();
services.AddScoped<IEmailChannelRepository, EmailChannelRepository>();
services.AddScoped<IEmailChannelUsageRepository, EmailChannelUsageRepository>();
services.AddScoped<IUnitOfWork, NotificationUnitOfWork>();
return services;
}
}