Пример #1
0
 public async Task <CatalogItemViewModel> GetItemById(int id, bool convertPrice = true, CancellationToken cancellationToken = default)
 {
     return(await _cache.GetOrCreateAsync(CacheHelpers.GenerateCatalogItemIdKey(id), async entry =>
     {
         entry.SlidingExpiration = CacheHelpers.DefaultCacheDuration;
         return await _catalogViewModelService.GetItemById(id, convertPrice, cancellationToken);
     }));
 }