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