Beispiel #1
0
        private string GetColorFromCache(int majorId)
        {
            var key   = $"major-color-{majorId}";
            var color = CacheHelper.GetFromCache <string>(key, _cache);

            if (!string.IsNullOrEmpty(color))
            {
                return(color);
            }

            color = $"#{_majorService.GetShortModel(majorId).Color}";
            CacheHelper.SetInCacheSliding(key, color, _cache);
            return(color);
        }
Beispiel #2
0
 private void PrepareMajor(int major)
 {
     MajorColor = MajorService.GetShortModel(major).Color;
 }