Exemple #1
0
        public LocalizationService(ILocalizationRepository localizationRepository, ICacheService cacheService)
        {
            var locals = cacheService.Get(CacheKeys.Phrase);

            if (locals == null)
            {
                _localizations = localizationRepository.AllAsync("en").Result.ToList();
                if (_localizations.Count > 0)
                {
                    cacheService.Set(CacheKeys.Phrase, _localizations);
                }
            }
            else
            {
                _localizations = (List <Localization>)locals;
            }
        }