21 lines
832 B
C#
21 lines
832 B
C#
namespace Kit.Helpers.Cache
|
|
{
|
|
using Microsoft.Extensions.Caching.Memory;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
public interface ICacheProvider
|
|
{
|
|
string CreateCacheName(object prefix, params object[] args);
|
|
bool Contains(string cacheName);
|
|
void PurgeCacheItems(string cacheName, bool isPrefix = false);
|
|
|
|
void SetCacheData<TObject>(string cacheName, TObject data, MemoryCacheEntryOptions? setProperties = null, PostEvictionDelegate? callback = null);
|
|
TResult GetCacheData<TResult>(string cacheName);
|
|
TResult GetCacheData<TResult>(string cacheName, Func<TResult> getMethod, MemoryCacheEntryOptions? setProperties = null, PostEvictionDelegate? callback = null);
|
|
}
|
|
}
|