better name for action cacheKey parameter

ref #505
This commit is contained in:
collinbarrett 2018-09-26 09:11:57 -05:00
parent e38c12e328
commit 6210af9749

View file

@ -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;