public static ViewModelCache GetViewModelCache(this IZetboxContext ctx, IPerfCounter perfCounter) { if (ctx == null) { throw new ArgumentNullException("ctx"); } object result; if (!ctx.TransientState.TryGetValue(CacheKey, out result)) { result = new ViewModelCache(perfCounter); ctx.TransientState[CacheKey] = result; } return((ViewModelCache)result); }
public static ViewModelCache GetViewModelCache(this IZetboxContext ctx, IPerfCounter perfCounter) { if (ctx == null) throw new ArgumentNullException("ctx"); object result; if (!ctx.TransientState.TryGetValue(CacheKey, out result)) { result = new ViewModelCache(perfCounter); ctx.TransientState[CacheKey] = result; } return (ViewModelCache)result; }