private static void InitCache() { if (Cache == null) { try { Cache = (ICache)Activator.CreateInstance(Type.GetType(ConfigurationManager.AppSettings["CacheAspect.CacheType"])); } catch { //if a cache is not configured, fall back on NoCache //this happens is useful for test cases Cache = new NoCache(); } } }
private static void InitCache() { if (Cache == null) { try { // ReSharper disable once AssignNullToNotNullAttribute Cache = (ICache)Activator.CreateInstance(Type.GetType(Configuration.CacheType)); } catch { //if a cache is not configured, fall back on NoCache //this happens is useful for test cases Cache = new NoCache(); } } }