public async Task <IHttpActionResult> SearchWall(string searchString, int page = 1) { if (!ModelState.IsValid) { return(BadRequest()); } var userAndOrg = GetUserAndOrganization(); var foundWallPosts = await _wallService.SearchWall(searchString, userAndOrg, page, WebApiConstants.DefaultPageSize); var mappedPosts = _mapper.Map <IList <WallPostViewModel> >(foundWallPosts); var pagedViewModel = new PagedWallViewModel <WallPostViewModel> { PagedList = mappedPosts.ToPagedList(1, WebApiConstants.DefaultPageSize), PageSize = WebApiConstants.DefaultPageSize }; return(Ok(pagedViewModel)); }