public static Aspect Cache <TReturnType>(this Aspect aspect, ICache cacheResolver, string key, int expiredTimes = 3600) { Func <TReturnType, TReturnType> func = null; Aspect aspect1 = aspect.Combine((Action work) => { Aspect aspect2 = aspect; ICache cache = cacheResolver; string str = key; Action action = work; if (func == null) { func = (TReturnType cached) => cached; } CacheAspectEx.Cache <TReturnType>(aspect2, cache, str, action, func, expiredTimes); }); return(aspect1); }