private static ILookupCodeCache LoadLookups(IContext arg) { ILookupCodeCache lookupCodeCache = null; System.Web.Caching.Cache cache = HttpContext.Current.Cache; if (cache["lookups"] == null) { lookupCodeCache = new LookupCodeCache(WebConfigurationManager.ConnectionStrings["connICBoulderValley"].ConnectionString); lookupCodeCache.Refresh(); cache.Add("lookups", lookupCodeCache, null, DateTime.Now.AddHours(8), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Low, null); } else { lookupCodeCache = (ILookupCodeCache)cache["lookups"]; } return(lookupCodeCache); }
public IncidentsController(IIncidentRepository incidentRepository, ILookupCodeCache lookupCodeCache) { this._incidentRepository = incidentRepository; this._lookupCodeCache = lookupCodeCache; }
public IncidentController(ISchoolRepository schoolRepository, ILookupCodeCache lookupCodeCache, string clearAuthenticationPrefix) { this._schoolRepository = schoolRepository; this._lookupCodeCache = lookupCodeCache; this._clearAuthenticationPrefix = clearAuthenticationPrefix; }