diff --git a/PARR.Core/DependencyInjection.cs b/PARR.Core/DependencyInjection.cs index db31ed37..c003bf91 100644 --- a/PARR.Core/DependencyInjection.cs +++ b/PARR.Core/DependencyInjection.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using PARR.Core.Common.Implementations; using PARR.Core.Common.Interfaces; +using PARR.Domain.Settings; namespace PARR.Core { @@ -23,7 +24,10 @@ namespace PARR.Core // Регим все валидаторы в Core services.AddValidatorsFromAssembly(typeof(DependencyInjection).Assembly, includeInternalTypes: true); - // Регистрируем сревисы Core + // Регим настройки + services.RegisterSettings(configuration); + + // --- Регистрируем сревисы Core --- #region Common @@ -53,5 +57,21 @@ namespace PARR.Core return services; } + + /// + /// Регистрация настроек + /// + /// + /// + /// + private static IServiceCollection RegisterSettings(this IServiceCollection services, IConfiguration configuration) + { + var groupedShortcodesCacheSettings = new GroupedShortcodesCacheSettings(); + configuration.GetSection(nameof(GroupedShortcodesCacheSettings)).Bind(groupedShortcodesCacheSettings); + services.AddSingleton(groupedShortcodesCacheSettings); + + return services; + } + } } diff --git a/PARR.DAL/Models/ApplicationsInWork.cs b/PARR.DAL/Models/ApplicationsInWork.cs index 9337019e..fac963fe 100644 --- a/PARR.DAL/Models/ApplicationsInWork.cs +++ b/PARR.DAL/Models/ApplicationsInWork.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -using PARR.DAL.Settings; using PARR.Domain.Entities.Base; +using PARR.Domain.Settings; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.DAL/Models/Job/JobGroup.cs b/PARR.DAL/Models/Job/JobGroup.cs index 0b11d5e5..faf9567d 100644 --- a/PARR.DAL/Models/Job/JobGroup.cs +++ b/PARR.DAL/Models/Job/JobGroup.cs @@ -2,8 +2,8 @@ using PARR.DAL.Context; using PARR.DAL.Models.Schedule; using PARR.DAL.Models.Unit; -using PARR.DAL.Settings; using PARR.Domain.Entities.Base; +using PARR.Domain.Settings; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.DAL/PARR.DAL.csproj b/PARR.DAL/PARR.DAL.csproj index 0c9d0180..ab3892e0 100644 --- a/PARR.DAL/PARR.DAL.csproj +++ b/PARR.DAL/PARR.DAL.csproj @@ -18,8 +18,6 @@ - - diff --git a/PARR.DAL/ParrDalInstaller.cs b/PARR.DAL/ParrDalInstaller.cs index afa66353..76ddc972 100644 --- a/PARR.DAL/ParrDalInstaller.cs +++ b/PARR.DAL/ParrDalInstaller.cs @@ -23,8 +23,8 @@ using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Schedule; using PARR.DAL.Services.Interfaces.Unit; -using PARR.DAL.Settings; using PARR.DAL.TaskServices; +using PARR.Domain.Settings; namespace PARR.DAL { @@ -64,9 +64,9 @@ namespace PARR.DAL //}); - var groupedShortcodesCacheSettings = new GroupedShortcodesCacheSettings(); - configuration.GetSection(nameof(GroupedShortcodesCacheSettings)).Bind(groupedShortcodesCacheSettings); - services.AddSingleton(groupedShortcodesCacheSettings); + //var groupedShortcodesCacheSettings = new GroupedShortcodesCacheSettings(); + //configuration.GetSection(nameof(GroupedShortcodesCacheSettings)).Bind(groupedShortcodesCacheSettings); + //services.AddSingleton(groupedShortcodesCacheSettings); //services.AddSingleton(); diff --git a/PARR.DAL/Settings/GroupedShortcodesCacheSettings.cs b/PARR.Domain/Settings/GroupedShortcodesCacheSettings.cs similarity index 86% rename from PARR.DAL/Settings/GroupedShortcodesCacheSettings.cs rename to PARR.Domain/Settings/GroupedShortcodesCacheSettings.cs index 948e1b25..2e05c6db 100644 --- a/PARR.DAL/Settings/GroupedShortcodesCacheSettings.cs +++ b/PARR.Domain/Settings/GroupedShortcodesCacheSettings.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.Settings +namespace PARR.Domain.Settings { public class GroupedShortcodesCacheSettings { diff --git a/PARR.DAL/Settings/PrefixSettings.cs b/PARR.Domain/Settings/PrefixSettings.cs similarity index 82% rename from PARR.DAL/Settings/PrefixSettings.cs rename to PARR.Domain/Settings/PrefixSettings.cs index 98606842..b4e2ae5c 100644 --- a/PARR.DAL/Settings/PrefixSettings.cs +++ b/PARR.Domain/Settings/PrefixSettings.cs @@ -1,9 +1,9 @@ -namespace PARR.DAL.Settings +namespace PARR.Domain.Settings { /// /// Для использования в моделе, в геттере, ApplicationInWork /// - internal static class PrefixSettings + public static class PrefixSettings { /// /// Префикс без динамической приставки diff --git a/PARR.MockData/EsppDataImporter.cs b/PARR.MockData/EsppDataImporter.cs index c33c843c..fc26e065 100644 --- a/PARR.MockData/EsppDataImporter.cs +++ b/PARR.MockData/EsppDataImporter.cs @@ -1,8 +1,4 @@ -using PARR.MockData.Data; -using RabbitMQ.Client; -using System.Text; - -namespace PARR.MockData +namespace PARR.MockData { internal class EsppDataImporter {