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(this IServiceCollection services) where TDbContext : DbContext, IMailDbContext => services .AddScoped>() .AddAutoMapper(typeof(MappingProfile).Assembly) .AddScoped(); public static IServiceCollection AddDispatcher(this IServiceCollection services, Action options) => services .AddDbContext(options) .AddDispatcher(); } }