using FluentValidation; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using PARR.Core.Common.Implementations; using PARR.Core.Common.Interfaces; namespace PARR.Core { public static class DependencyInjection { /// /// Регистрация Core (BLL) сервисов /// /// /// /// public static IServiceCollection AddCoreServices(this IServiceCollection services, IConfiguration configuration) { // Регим профили AutoMapper services.AddBllMapping(); // Регим все валидаторы в Core services.AddValidatorsFromAssembly(typeof(DependencyInjection).Assembly, includeInternalTypes: true); // Регистрируем сревисы Core #region Common services.AddTransient(); #endregion #region Services //services.AddScoped(); #endregion return services; } private static IServiceCollection AddBllMapping(this IServiceCollection services) { // AutoMapper services.AddAutoMapper(cfg => { // регим все в Core cfg.AddMaps(typeof(DependencyInjection).Assembly); }); return services; } } }