AspNet.StarterKits.Classifieds.Web.LocationCache.GetAllCategories C# (CSharp) Method

GetAllCategories() public static method

public static GetAllCategories ( HttpContext context ) : List
context System.Web.HttpContext
return List
		public static List<CachedLocation> GetAllCategories(HttpContext context)
		{
			if (context == null)
				return null;

			DateTime expiration = DateTime.Now.AddDays(1);
			List<CachedLocation> allLocations = context.Cache[AllLocationsKey] as List<CachedLocation>;
			if (allLocations == null)
			{
				allLocations = FetchAllLocations();
				context.Cache.Add(AllLocationsKey, allLocations, null, expiration, TimeSpan.Zero, System.Web.Caching.CacheItemPriority.High, null);
			}
			return allLocations;
		}