Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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));
        }