mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
e38c12e328
commit
6210af9749
1 changed files with 2 additions and 2 deletions
|
|
@ -30,10 +30,10 @@ protected BaseController(IMemoryCache memoryCache, SeedService seedService)
|
|||
}
|
||||
|
||||
//https://stackoverflow.com/a/52506210/2343739
|
||||
protected async Task<IActionResult> Get<T>(Func<Task<T>> createAction, int? actionParam = null,
|
||||
protected async Task<IActionResult> Get<T>(Func<Task<T>> createAction, int? paramCacheKey = null,
|
||||
[CallerMemberName] string actionName = null)
|
||||
{
|
||||
var cacheKey = GetType().Name + "_" + actionName + "_" + actionParam;
|
||||
var cacheKey = GetType().Name + "_" + actionName + "_" + paramCacheKey;
|
||||
var result = await memoryCache.GetOrCreateAsync(cacheKey, entry =>
|
||||
{
|
||||
entry.AbsoluteExpirationRelativeToNow = MemoryCacheExpirationDefault;
|
||||
|
|
|
|||
Loading…
Reference in a new issue