oops, something went wrong with the post! code is:
public static InfoDataSet<CategoryInfo> GetCurrentDocumentCategories()
{
return GetDocumentCategories(CMSContext.CurrentDocument.DocumentID, CMSContext.CurrentDocument.ClassName);
}
public static InfoDataSet<CategoryInfo> GetDocumentCategories(int documentId, string className)
{
className = className.ToLower();
InfoDataSet<CategoryInfo> dataSet = null;
using (var cs = new CachedSection<InfoDataSet<CategoryInfo>>(ref dataSet, 5, true, null, string.Format("Custom.DocumentCategories|{0}|byid|{1}", className, documentId)))
{
if (cs.LoadData)
{
dataSet = CategoryInfoProvider.GetDocumentCategories(documentId, null, "CategoryOrder", -1, null);
cs.CacheDependency = CacheHelper.GetCacheDependency(string.Format("{0}|byid|{1}", className, documentId));
cs.Data = dataSet;
}
}
return dataSet;
}