Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public ActionResult GetPost(int postId)
        {
            var post = _dataService.GetPost(postId);

            if (post == null)
            {
                return(NotFound());
            }
            return(Ok(post));
        }