예제 #1
0
        /// <summary>
        /// Gets all categories.
        /// </summary>
        /// <returns></returns>
        public IList <Category> GetAll()
        {
            SharePointListDescriptor items = Provider.GetAllListItems(ForumConstants.Lists_Category);

            IList <Category> categoryCollection = new List <Category>();

            foreach (SharePointListItem listItem in items.SharePointListItems)
            {
                categoryCollection.Add(CategoryMapper.CreateDomainObject(listItem));
            }
            return(categoryCollection);
        }
예제 #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));
        }