public ResultModel <List <Student> > GetFromCache()
        {
            var cacheKey = "studentCache";

            var result = _cachingManager.GetFromCache <List <Student> >(cacheKey);

            return(result);
        }
Exemplo n.º 2
0
        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}");
        }