public ActionResult <CategoryReadWithPostsDto> GetCategory_with_postsById(int id) { var postItem = _repository.GetCategoryByIdWithPosts(id); if (postItem != null) { return(Ok(_mapper.Map <CategoryReadWithPostsDto>(postItem))); } return(NotFound()); }