/// <summary> /// Gets all of the posts that have a type id of 'request an item' /// </summary> /// <returns>a view of all the item request post previews.</returns> public ActionResult GetAllItemRequestPosts() { PostModel model = new PostModel(); model.UserLoginName = claimsHelper.GetUserNameFromClaim((ClaimsIdentity)User.Identity); GetAllItemRequestPostsQuery postQuery = new GetAllItemRequestPostsQuery(); model.AllPostsForCategory = commandBus.ProcessQuery(postQuery); model.CategoryTitle = "All Item Requests"; return(View(ViewNames.PostIndex, model)); }
/// <summary> /// Handler for the Get all Item Request Post Query /// </summary> /// <param name="query">the GetAllITemRequestPosts Query</param> /// <returns>a collection of post previews for all of the item request posts</returns> public IEnumerable <PostPreview> Handle(GetAllItemRequestPostsQuery query) { return(postRepository.GetAllItemRequestPosts()); }