public ResultModel <List <Student> > GetFromCache() { var cacheKey = "studentCache"; var result = _cachingManager.GetFromCache <List <Student> >(cacheKey); return(result); }
private async Task <string> GetArtoClipUrl() { if (_cachingService.IsCached(CacheKeys.ArtoClipVideoIds) == false) { _cachingService.SetCache <List <string> >(CacheKeys.ArtoClipVideoIds, await GetAllArtoClipIds()); } List <string> clipIds = _cachingService.GetFromCache <List <string> >(CacheKeys.ArtoClipVideoIds); Random rnd = new(); string clip = clipIds.ElementAt(rnd.Next(clipIds.Count())); return($"https://www.youtube.com/watch?v={clip}"); }