public IActionResult GetAllPosts() { var posts = getPostsQuery.Execute().ToList(); if (posts != null && posts.Count > 0) { return(Ok(posts)); } return(NotFound()); }