/// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="config">Конфигурация.</param>
        /// <param name="externals">Внешнее.</param>
        public CoreCachingContext(CoreCachingConfig config, CoreCachingExternals externals)
        {
            Config = config;

            MemoryCache = new MemoryCache(externals.MemoryCacheOptions ?? new MemoryCacheOptions());

            Resources = new CoreCachingResources(externals.ResourceErrorsLocalizer);

            InitStorages();

            var helper = Storages?.Global?.Helper;

            if (helper != null && !helper.IsFaulty)
            {
                helper.Subscribe(RemoveDataFromLocalStorage, RemoveAllDataFromLocalStorage);
            }

            Cache = CreateCache();
        }
 /// <summary>
 /// Инициализировать конфигурацию.
 /// </summary>
 /// <param name="environment">Окружение.</param>
 public void InitConfig(CoreBaseEnvironment environment)
 {
     Config = new CoreCachingConfig(environment);
 }