Beispiel #1
0
 private void InitStorages()
 {
     if (Config.Settings.IsCachingEnabled)
     {
         Storages = new CoreCachingStorages(MemoryCache, Config.Settings, Resources.Errors);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="resourceErrors">Ресурс ошибок.</param>
        /// <param name="storages">Хранилища.</param>
        public CoreCachingCache(CoreCachingResourceErrors resourceErrors, CoreCachingStorages storages)
        {
            ResourceErrors = resourceErrors;

            IsEnabled = Storages != null;

            if (IsEnabled)
            {
                GlobalStorageHelper  = Storages?.Global?.Helper;
                GlobalStorageService = Storages?.Global?.Service;
                LocalStorageService  = Storages?.Local?.Service;

                IsFaulty = GlobalStorageHelper != null && GlobalStorageHelper.IsFaulty;
            }
        }