Refactor: Projekt von DigitalData.EmailProfilerDispatcher.Application in DigitalData.EmailProfilerDispatcher umbenannt, um die Struktur zu vereinfachen und die Abstraktion zu verbessern

This commit is contained in:
Developer 02
2024-07-01 14:52:54 +02:00
parent d18b6df9f7
commit a56ede375d
8 changed files with 14 additions and 19 deletions

View File

@@ -0,0 +1,20 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using DigitalData.EmailProfilerDispatcher.Repositories;
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace DigitalData.EmailProfilerDispatcher
{
public static class DIExtensions
{
public static IServiceCollection AddDispatcher<TDbContext>(this IServiceCollection services) where TDbContext : DbContext => services
.AddScoped<IEmailOutRepository, EmailOutRepository<TDbContext>>()
.AddAutoMapper(typeof(MappingProfile).Assembly)
.AddScoped<IEmailOutService, EmailOutService>();
public static IServiceCollection AddDispatcher<TResource>(this IServiceCollection services, Action<DbContextOptionsBuilder> options) => services
.AddDbContext<DefaultMailDbContext>(options)
.AddDispatcher<DefaultMailDbContext>();
}
}