AspNet.StarterKits.Classifieds.Web.CategoryCache.GetCategoriesByParentId C# (CSharp) Метод

GetCategoriesByParentId() публичный статический Метод

public static GetCategoriesByParentId ( HttpContext context, int parentCategoryId, bool updateFrequently ) : List
context System.Web.HttpContext
parentCategoryId int
updateFrequently bool
Результат List
		public static List<CachedCategory> GetCategoriesByParentId(HttpContext context, int parentCategoryId, bool updateFrequently)
		{
			string cacheKey = (updateFrequently ? "BR" : "SC") + parentCategoryId.ToString();
			DateTime expiration = updateFrequently ? DateTime.Now.AddSeconds(1) : DateTime.Now.AddDays(1);

			List<CachedCategory> subCategories = context.Cache[cacheKey] as List<CachedCategory>;
			if (subCategories == null)
			{
				subCategories = FetchCategoriesByParentId(parentCategoryId);
				CacheDependency watchAllCategoriesKey = new System.Web.Caching.CacheDependency(null, AllCategoriesKeyArrayWrap);
				context.Cache.Add(cacheKey, subCategories, watchAllCategoriesKey, expiration, TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Normal, null);
			}
			return subCategories;
		}

Same methods

CategoryCache::GetCategoriesByParentId ( int parentCategoryId ) : List