using DigitalData.EmailProfilerDispatcher.Application.Contracts; using DigitalData.EmailProfilerDispatcher.Application.Services; using DigitalData.EmailProfilerDispatcher.Infrastructure; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; namespace DigitalData.EmailProfilerDispatcher.Application { public static class DIExtensions { public static IServiceCollection AddDispatcher(this IServiceCollection services) where TDbContext : DbContext => services .AddDispatcherRepository() .AddAutoMapper(typeof(MappingProfile).Assembly) .AddScoped(); public static IServiceCollection AddDispatcher(this IServiceCollection services, Action options) => services .AddDbContext(options) .AddDispatcher(); } }