Esempio n. 1
0
        /// <inheritdoc/>
        public override void InitContext(IServiceProvider serviceProvider, CoreBaseEnvironment environment)
        {
            base.InitContext(serviceProvider, environment);

            ModAuthBase?.InitContext(new ModAuthBaseExternals
            {
                CoreBaseResourceErrors     = CoreBase?.Context.Resources.Errors,
                ResourceErrorsLocalizer    = GetLocalizer <ModAuthBaseResourceErrors>(serviceProvider),
                ResourceSuccessesLocalizer = GetLocalizer <ModAuthBaseResourceSuccesses>(serviceProvider)
            });

            ModDummyMainBase?.InitContext(new ModDummyMainBaseExternals
            {
                CoreBaseResourceErrors     = CoreBase?.Context.Resources.Errors,
                CoreBaseDataProvider       = CoreDataSqlServer?.Context.Provider,
                DataBaseSettings           = DataBase?.Context.Settings,
                DataEntityDbFactory        = DataEntitySqlServer?.Context.DbFactory,
                ResourceErrorsLocalizer    = GetLocalizer <ModDummyMainBaseResourceErrors>(serviceProvider),
                ResourceSuccessesLocalizer = GetLocalizer <ModDummyMainBaseResourceSuccesses>(serviceProvider)
            });

            ModProductBase?.InitContext(new ModProductBaseExternals
            {
                CoreBaseResourceErrors     = CoreBase?.Context.Resources.Errors,
                CoreBaseDataProvider       = CoreDataSqlServer?.Context.Provider,
                DataBaseSettings           = DataBase?.Context.Settings,
                DataEntityDbFactory        = DataEntitySqlServer?.Context.DbFactory,
                ResourceErrorsLocalizer    = GetLocalizer <ModProductBaseResourceErrors>(serviceProvider),
                ResourceSuccessesLocalizer = GetLocalizer <ModProductBaseResourceSuccesses>(serviceProvider)
            });
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public sealed override void InitContext(IServiceProvider serviceProvider, CoreBaseEnvironment environment)
        {
            base.InitContext(serviceProvider, environment);

            CoreCaching?.InitContext(new CoreCachingExternals
            {
                MemoryCacheOptions      = new MemoryCacheOptions(),
                ResourceErrorsLocalizer = GetLocalizer <CoreCachingResourceErrors>(serviceProvider)
            });

            ModDummyMainCaching?.InitContext(new ModDummyMainCachingExternals
            {
                Cache = CoreCaching.Context.Cache,
                CoreBaseResourceErrors    = CoreBase.Context.Resources.Errors,
                CoreCachingResourceErrors = CoreCaching.Context.Resources.Errors,
                DataBaseSettings          = DataBase.Context.Settings,
                ResourceErrors            = ModDummyMainBase.Context.Resources.Errors,
                ResourceSuccesses         = ModDummyMainBase.Context.Resources.Successes,
                Service = ModDummyMainBase.Context.Service
            });
            ModProductCaching?.InitContext(new ModProductCachingExternals
            {
                Cache = CoreCaching.Context.Cache,
                CoreBaseResourceErrors    = CoreBase.Context.Resources.Errors,
                CoreCachingResourceErrors = CoreCaching.Context.Resources.Errors,
                DataBaseSettings          = DataBase.Context.Settings,
                ResourceErrors            = ModProductBase.Context.Resources.Errors,
                ResourceSuccesses         = ModProductBase.Context.Resources.Successes,
                Service = ModProductBase.Context.Service
            });
        }
Esempio n. 3
0
        /// <inheritdoc/>
        public sealed override void InitConfig(CoreBaseEnvironment environment)
        {
            base.InitConfig(environment);

            CoreCaching?.InitConfig(environment);
            ModDummyMainCaching?.InitConfig(environment);
        }
Esempio n. 4
0
        /// <inheritdoc/>
        public override void InitConfig(CoreBaseEnvironment environment)
        {
            base.InitConfig(environment);

            ModAuthBase?.InitConfig(environment);
            ModDummyMainBase?.InitConfig(environment);
        }
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="environment">Окружение.</param>
        public ModAutomationBaseConfig(CoreBaseEnvironment environment)
        {
            Environment = environment;

            FilePath = CreateFilePath();

            Settings = ModAutomationBaseConfigSettings.Create(FilePath, Environment);
        }
Esempio n. 6
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="settings">Настройки.</param>
 /// <param name="filePath">Путь к файлу.</param>
 /// <param name="environment">Окружение.</param>
 public CoreCachingConfigProvider(
     CoreCachingConfigSettings settings,
     string filePath,
     CoreBaseEnvironment environment
     )
     : base(settings, filePath, environment)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="settings">Настройки.</param>
 /// <param name="filePath">Путь к файлу.</param>
 /// <param name="environment">Окружение.</param>
 public ModDummyMainCachingConfigProvider(
     ModDummyMainCachingConfigSettings settings,
     string filePath,
     CoreBaseEnvironment environment
     )
     : base(settings, filePath, environment)
 {
 }
Esempio n. 8
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="environment">Окружение.</param>
        public ModDummyMainCachingConfig(CoreBaseEnvironment environment)
        {
            Environment = environment;

            FilePath = CreateFilePath();

            Settings = ModDummyMainCachingConfigSettings.Create(FilePath, Environment);
        }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="settings">Настройки.</param>
 /// <param name="filePath">Путь к файлу.</param>
 /// <param name="environment">Окружение.</param>
 public HostBaseConfigProvider(
     HostBaseConfigSettings settings,
     string filePath,
     CoreBaseEnvironment environment
     )
     : base(settings, filePath, environment)
 {
 }
Esempio n. 10
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="environment">Окружение.</param>
        public HostBaseConfig(CoreBaseEnvironment environment)
        {
            Environment = environment;

            FilePath = CreateFilePath();

            Settings = HostBaseConfigSettings.Create(FilePath, Environment);
        }
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="environment">Окружение.</param>
        public ModIdentityServerWebMvcConfig(CoreBaseEnvironment environment)
        {
            Environment = environment;

            FilePath = CreateFilePath();

            Settings = ModIdentityServerWebMvcConfigSettings.Create(FilePath, Environment);
        }
 /// <inheritdoc/>
 public DataEntitySqlServerDbFactory()
     : base()
 {
     Environment = new CoreBaseEnvironment()
     {
         BasePath = System.AppContext.BaseDirectory,
     };
 }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="settings">Настройки.</param>
 /// <param name="filePath">Путь к файлу.</param>
 /// <param name="environment">Окружение.</param>
 public ModIdentityServerBaseConfigProvider(
     ModIdentityServerBaseConfigSettings settings,
     string filePath,
     CoreBaseEnvironment environment
     )
     : base(settings, filePath, environment)
 {
 }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="settings">Настройки.</param>
 /// <param name="filePath">Путь к файлу.</param>
 /// <param name="environment">Окружение.</param>
 public ModAutomationBaseConfigProvider(
     ModAutomationBaseConfigSettings settings,
     string filePath,
     CoreBaseEnvironment environment
     )
     : base(settings, filePath, environment)
 {
 }
Esempio n. 15
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="environment">Окружение.</param>
        public CoreCachingConfig(CoreBaseEnvironment environment)
        {
            Environment = environment;

            FilePath = CreateFilePath();

            Settings = CoreCachingConfigSettings.Create(FilePath, Environment);
        }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="settings">Настройки.</param>
 /// <param name="filePath">Путь к файлу.</param>
 /// <param name="environment">Окружение.</param>
 public DataEntitySqlServerConfigProvider(
     DataEntitySqlServerConfigSettings settings,
     string filePath,
     CoreBaseEnvironment environment
     )
     : base(settings, filePath, environment)
 {
 }
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="environment">Окружение.</param>
        public DataEntitySqlServerConfig(CoreBaseEnvironment environment)
        {
            Environment = environment;

            FilePath = CreateFilePath();

            Settings = DataEntitySqlServerConfigSettings.Create(FilePath, Environment);
        }
Esempio n. 18
0
 /// <inheritdoc/>
 public DataEntitySqlServerDbFactory(
     string connectionString,
     DataBaseSettings dataBaseSettings,
     CoreBaseEnvironment environment
     )
     : base(connectionString, dataBaseSettings)
 {
     Environment = environment;
 }
Esempio n. 19
0
        /// <summary>
        /// Создать.
        /// </summary>
        /// <param name="configFilePath">Путь к файлу конфигурации.</param>
        /// <param name="environment">Окружение.</param>
        /// <returns>Конфигурационные настройки.</returns>
        internal static IHostBaseConfigSettings Create(string configFilePath, CoreBaseEnvironment environment)
        {
            var result = new HostBaseConfigSettings();

            var configProvider = new HostBaseConfigProvider(result, configFilePath, environment);

            configProvider.Load();

            return(result);
        }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="settings">Настройки.</param>
 /// <param name="filePath">Путь к файлу.</param>
 /// <param name="environment">Окружение.</param>
 public CoreBaseCommonConfigProviderJson(
     TSettings settings,
     string filePath,
     CoreBaseEnvironment environment
     )
     : base(settings)
 {
     Environment = environment;
     FilePath    = filePath;
 }
Esempio n. 21
0
        /// <inheritdoc/>
        public override void InitContext(IServiceProvider serviceProvider, CoreBaseEnvironment environment)
        {
            base.InitContext(serviceProvider, environment);

            ModAutomationBase?.InitContext(new ModAutomationBaseExternals
            {
                CoreBaseResourceErrors     = CoreBase?.Context.Resources.Errors,
                ResourceErrorsLocalizer    = GetLocalizer <ModAutomationBaseResourceErrors>(serviceProvider),
                ResourceSuccessesLocalizer = GetLocalizer <ModAutomationBaseResourceSuccesses>(serviceProvider)
            });
        }
Esempio n. 22
0
        /// <inheritdoc/>
        public override void InitContext(IServiceProvider serviceProvider, CoreBaseEnvironment environment)
        {
            base.InitContext(serviceProvider, environment);

            ModIdentityServerBase?.InitContext(new ModIdentityServerBaseExternals
            {
                ResourceErrorsLocalizer    = GetLocalizer <ModIdentityServerBaseResourceErrors>(serviceProvider),
                ResourceSuccessesLocalizer = GetLocalizer <ModIdentityServerBaseResourceSuccesses>(serviceProvider),
                ResourceTitlesLocalizer    = GetLocalizer <ModIdentityServerBaseResourceTitles>(serviceProvider)
            });
        }
        /// <summary>
        /// Создать.
        /// </summary>
        /// <param name="configFilePath">Путь к файлу конфигурации.</param>
        /// <param name="environment">Окружение.</param>
        /// <returns>Конфигурационные настройки.</returns>
        internal static IDataEntitySqlServerConfigSettings Create(
            string configFilePath,
            CoreBaseEnvironment environment
            )
        {
            var result = new DataEntitySqlServerConfigSettings();

            var configProvider = new DataEntitySqlServerConfigProvider(result, configFilePath, environment);

            configProvider.Load();

            return(result);
        }
Esempio n. 24
0
        /// <summary>
        /// Настроить конфигурацию приложения.
        /// </summary>
        /// <param name="configurationBuilder">Построитель конфигурации.</param>
        /// <param name="basePath">
        /// Абсолютный путь к папке, относительно которой указываются пути к файлам.
        /// </param>
        /// <param name="environmentName">Имя окружения.</param>
        public void ConfigureAppConfiguration(
            IConfigurationBuilder configurationBuilder,
            string basePath,
            string environmentName
            )
        {
            Environment = new CoreBaseEnvironment
            {
                BasePath = basePath,
                Name     = environmentName
            };

            var appConfigFilePath = Path.Combine(Environment.BasePath, "ConfigFiles", "App.config");

            configurationBuilder.CoreBaseExtConfigAddFromJsonFile(
                appConfigFilePath,
                Environment.Name
                ).AddEnvironmentVariables();
        }
        /// <inheritdoc/>
        public sealed override void InitContext(IServiceProvider serviceProvider, CoreBaseEnvironment environment)
        {
            base.InitContext(serviceProvider, environment);

            ModIdentityServerWebMvc?.InitContext(new ModIdentityServerWebMvcExternals
            {
                PartAccount = new ModIdentityServerWebMvcPartAccountExternals
                {
                    CoreBaseResourceErrors = CoreBase.Context.Resources.Errors,
                    ResourceErrors         = ModIdentityServerBase.Context.Resources.Errors,
                    ResourceSuccesses      = ModIdentityServerBase.Context.Resources.Successes,
                    ResourceTitles         = ModIdentityServerBase.Context.Resources.Titles
                },
                PartExternal = new ModIdentityServerWebMvcPartExternalExternals
                {
                    CoreBaseResourceErrors = CoreBase.Context.Resources.Errors,
                    ResourceErrors         = ModIdentityServerBase.Context.Resources.Errors
                }
            });
        }
Esempio n. 26
0
        /// <inheritdoc/>
        public sealed override void Load()
        {
            var configurationBuilder = new ConfigurationBuilder();

            Environment = new CoreBaseEnvironment()
            {
                BasePath = System.AppContext.BaseDirectory,
                Name     = "j"
            };

            var isAbsolutePath = FilePath.StartsWith(
                Environment.BasePath,
                StringComparison.InvariantCultureIgnoreCase
                );
            var absolutePathToFile = isAbsolutePath
                ? FilePath
                : Path.Combine(Environment.BasePath, FilePath);

            var isPathToFileWithExtension = FilePath.EndsWith(
                ".json",
                StringComparison.InvariantCultureIgnoreCase
                );

            if (isPathToFileWithExtension)
            {
                configurationBuilder.AddJsonFile(absolutePathToFile);
            }
            else
            {
                configurationBuilder.CoreBaseExtConfigAddFromJsonFile(
                    absolutePathToFile,
                    Environment.Name
                    );
            }

            var configuration = configurationBuilder.AddEnvironmentVariables().Build();

            var cn = configuration["ConnectionString"];

            configuration.Bind(Settings);
        }
Esempio n. 27
0
        /// <summary>
        /// Инициализировать контекст.
        /// </summary>
        /// <param name="serviceProvider">Поставщик сервисов.</param>
        /// <param name="environment">Окружение.</param>
        public virtual void InitContext(IServiceProvider serviceProvider, CoreBaseEnvironment environment)
        {
            CoreBase?.InitContext(new CoreBaseExternals
            {
                ResourceConvertingLocalizer = GetLocalizer <CoreBaseResourceConverting>(serviceProvider),
                ResourceErrorsLocalizer     = GetLocalizer <CoreBaseResourceErrors>(serviceProvider)
            });

            DataEntitySqlServer?.InitContext(new DataEntitySqlServerExternals
            {
                DataBaseSettings = DataBase?.Context.Settings,
                Environment      = environment
            });

            DataEntity?.InitContext(new DataEntityExternals
            {
                CoreBaseResourceErrors = CoreBase?.Context.Resources.Errors,
                DataEntityDbFactory    = DataEntitySqlServer?.Context.DbFactory
            });

            HostBase?.InitContext(new HostBaseExternals
            {
                PartAuth = new HostBasePartAuthExternals
                {
                    CoreBaseResourceErrors     = CoreBase?.Context.Resources.Errors,
                    ResourceErrorsLocalizer    = GetLocalizer <HostBasePartAuthResourceErrors>(serviceProvider),
                    ResourceSuccessesLocalizer = GetLocalizer <HostBasePartAuthResourceSuccesses>(serviceProvider)
                },
                PartLdap = new HostBasePartLdapExternals
                {
                    CoreBaseResourceErrors     = CoreBase?.Context.Resources.Errors,
                    ResourceErrorsLocalizer    = GetLocalizer <HostBasePartLdapResourceErrors>(serviceProvider),
                    ResourceSuccessesLocalizer = GetLocalizer <HostBasePartLdapResourceSuccesses>(serviceProvider)
                }
            });
        }
Esempio n. 28
0
 /// <summary>
 /// Инициализировать конфигурацию.
 /// </summary>
 /// <param name="environment">Окружение.</param>
 public void InitConfig(CoreBaseEnvironment environment)
 {
     Config = new DataEntitySqlServerConfig(environment);
 }
Esempio n. 29
0
        /// <summary>
        /// Создать.
        /// </summary>
        /// <param name="configFilePath">Путь к файлу конфигурации.</param>
        /// <param name="environment">Окружение.</param>
        /// <returns>Конфигурационные настройки.</returns>
        internal static ICoreCachingCommonClientConfigSettings Create(string configFilePath, CoreBaseEnvironment environment)
        {
            var result = new ModDummyMainCachingConfigSettings();

            var configProvider = new ModDummyMainCachingConfigProvider(result, configFilePath, environment);

            configProvider.Load();

            return(result);
        }
Esempio n. 30
0
 /// <summary>
 /// Инициализировать конфигурацию.
 /// </summary>
 /// <param name="environment">Окружение.</param>
 public virtual void InitConfig(CoreBaseEnvironment environment)
 {
     DataEntitySqlServer?.InitConfig(environment);
     HostBase?.InitConfig(environment);
 }