public ActionResult SimpleSearch(int userId, string query) { List <int> postid = _searchService.SimpleSearch(userId, query.ToLower()); List <Post> results = new List <Post>(); foreach (int pid in postid) { results.Add(_dataService.GetPost(pid)); } return(Ok(results)); }
public ActionResult GetPost(int postId) { var post = _dataService.GetPost(postId); if (post == null) { return(NotFound()); } return(Ok(post)); }