This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//extension method make a database call by providing a function pointer to Task<T> and passing in a method parameter | |
public static async Task<T> DatabaseCall<T>(this IDatabase cache, string key, Func<string, Task<T>> databaseCall, string methodParameter, TimeSpan timeSpan, bool invalidate, bool useCache) | |
{ | |
T returnValue; | |
var cachedItem = default(T); | |
try | |
{ | |
cachedItem = await cache.GetAsync<T>(key); | |
} | |
catch (RedisConnectionException ex) |