ee4c988a0d
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
27 lines
967 B
C#
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;
|
|
}
|
|
}
|