public ActionResult Article(string id, string title) { var cacheKey = string.Format(CacheKeyTemplate.PostByIdCacheKey, id); var post = _redisCacheService.GetOrSet(key: cacheKey, factory: () => _postService.Get(id), cacheTimeInMinutes: 60); return(View(post)); }
public ValueModel Get(int id) { var cacheKey = string.Format(ValuesCacheKeyTemplate.ValueByIdCacheKey, id); return(_redisCacheService.GetOrSet(key: cacheKey, factory: () => _values.FirstOrDefault(v => v.Id == id), cacheTimeInMinutes: 60)); }
public PostOutput Get(string id) { var cacheKey = string.Format(CacheKeyTemplate.PostByIdCacheKey, id); return(_redisCacheService.GetOrSet(key: cacheKey, factory: () => _postService.Get(id), cacheTimeInMinutes: 60)); }