Exemple #1
0
        public async Task <IActionResult> GetPost(int id)
        {
            PostDto postDto = _mapper.Map <PostDto>(await _getPostInput.GetPost(id));
            ApiResponse <PostDto> apiResponse = new ApiResponse <PostDto>(postDto);

            return(Ok(apiResponse));
        }
Exemple #2
0
        public async Task <bool> UpdatePost(Post post)
        {
            Post currentPost = await _getPostInput.GetPost(post.Id);

            if (currentPost != null)
            {
                currentPost.Image       = post.Image;
                currentPost.Description = post.Description;

                await _updatePostOutput.UpdatePost(currentPost);

                return(true);
            }
            return(false);
        }