Ejemplo n.º 1
0
        public async Task <IActionResult> GetPosts(string topicName)
        {
            List <Post> posts = await topicObj.GetPostsForTopicAsync(topicName);

            if (posts.Any())
            {
                return(Ok(posts));
            }
            else
            {
                return(NotFound("Posts for this topic not found"));
            }
        }