protected override void UpdateCache(CommandResponse <Vote> result)
 {
     if (result.Success)
     {
         CacheHandler.Instance.Remove(CachingKey.Vote(result.Response.ID));
     }
 }
Ejemplo n.º 2
0
        protected override async Task <IEnumerable <Vote> > GetData()
        {
            using (var repo = new Repository(User))
            {
                var result = await repo.GetVotes(_subverse, _options);

                //Add to cache
                if (result != null && result.Any())
                {
                    result.ForEach(x => CacheHandler.Replace(CachingKey.Vote(x.ID), x, TimeSpan.FromMinutes(30)));
                }

                return(result);
            }
        }