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); }
private void PrepareMajor(int major) { MajorColor = MajorService.GetShortModel(major).Color; }