Exemple #1
0
        public async Task <PagedResult <Wish> > FindByUserIdAsync(int userId, int page, int pageSize)
        {
            String cacheKey = $"{CacheKeys.WishesList}-{userId}-{page}-{pageSize}";

            return(await _cache.GetOrCreateAsync(cacheKey, (entry) =>
            {
                entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(1);
                return _wishRepository.FindByUserIdAsync(userId, page, pageSize);
            }));
        }