Exemple #1
0
        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);
        }
Exemple #2
0
 public IncidentsController(IIncidentRepository incidentRepository, ILookupCodeCache lookupCodeCache)
 {
     this._incidentRepository = incidentRepository;
     this._lookupCodeCache    = lookupCodeCache;
 }
Exemple #3
0
 public IncidentController(ISchoolRepository schoolRepository, ILookupCodeCache lookupCodeCache, string clearAuthenticationPrefix)
 {
     this._schoolRepository          = schoolRepository;
     this._lookupCodeCache           = lookupCodeCache;
     this._clearAuthenticationPrefix = clearAuthenticationPrefix;
 }