Example #1
0
        public static void RemoveLanguageCache(this DistributedCache dc, ILanguage language)
        {
            if (language == null)
            {
                return;
            }

            var payload = new LanguageCacheRefresher.JsonPayload(language.Id, language.IsoCode, LanguageCacheRefresher.JsonPayload.LanguageChangeType.Remove);

            dc.RefreshByPayload(LanguageCacheRefresher.UniqueId, new[] { payload });
        }
Example #2
0
        public static void RefreshLanguageCache(this DistributedCache dc, ILanguage language)
        {
            if (language == null)
            {
                return;
            }

            var payload = new LanguageCacheRefresher.JsonPayload(language.Id, language.IsoCode,
                                                                 language.WasPropertyDirty(nameof(ILanguage.IsoCode))
                    ? LanguageCacheRefresher.JsonPayload.LanguageChangeType.ChangeCulture
                    : LanguageCacheRefresher.JsonPayload.LanguageChangeType.Update);

            dc.RefreshByPayload(LanguageCacheRefresher.UniqueId, new[] { payload });
        }