12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Extensions.Caching.Memory;
- namespace Ropin.Core.Common
- {
-
-
-
- public class MemoryCaching : ICaching
- {
-
- private readonly IMemoryCache _cache;
-
- public MemoryCaching(IMemoryCache cache)
- {
- _cache = cache;
- }
- public object Get(string cacheKey)
- {
- return _cache.Get(cacheKey);
- }
- public void Set(string cacheKey, object cacheValue, int timeSpan)
- {
- _cache.Set(cacheKey, cacheValue, TimeSpan.FromSeconds(timeSpan * 60));
- }
- }
- }
|