public async Task <PostDtos> UpdatePost(int id, [FromBody] PostDtos postDtos) { var post = await _unitOfWork.PostRepository.GetPost(id); //_mapper.Map<PostDtos, Post>(postDtos, post); await _unitOfWork.CompleteAsync(); post = await _unitOfWork.PostRepository.GetPost(postDtos.PostId); var result = _mapper.Map <Post, PostDtos>(post); return(result); }
//[Authorize] public async Task <IActionResult> UpdatePost(int id, [FromBody] PostDtos postDtos) => Ok(await _postService.UpdatePost(id, postDtos));