/// <summary> /// Gets all categories. /// </summary> /// <returns></returns> public CategoryCollection GetAll() { SharePointListDescriptor items = Provider.GetAllListItems(ForumConstants.Lists_Category); CategoryCollection categoryCollection = new CategoryCollection(); foreach (SharePointListItem listItem in items.SharePointListItems) { categoryCollection.Add(CategoryMapper.CreateDomainObject(listItem)); } return(categoryCollection); }
/// <summary> /// Gets a category by its identity. /// </summary> /// <param name="id">The id.</param> /// <returns></returns> public Category GetById(int id) { SharePointListItem currentItem = Provider.GetListItembyID(ForumConstants.Lists_Category, id); return(CategoryMapper.CreateDomainObject(currentItem)); }