private static List<CachedCategory> FetchParentCategoriesById(int categoryId)
{
List<CachedCategory> parentCategories = new List<CachedCategory>();
CategoriesDataComponent.CategoriesDataTable parentsResult = CategoriesDB.GetParentCategoriesById(categoryId);
foreach (CategoriesDataComponent.CategoriesRow parentCategory in parentsResult)
{
int parentCategoryId = DefaultValues.CategoryIdMinValue;
// must ensure that we don't access a NULL field
if (!parentCategory.IsParentCategoryIdNull())
parentCategoryId = parentCategory.ParentCategoryId;
parentCategories.Add(new CachedCategory(parentCategory.Name, parentCategory.Id, parentCategoryId, parentCategory.NumActiveAds, String.Empty));
}
return parentCategories;
}