public async Task <ActionResult> UpdateUserPostAsync(Guid id, [FromBody] UserPostUpdateDto post) { var userPostModel = await _userPostService.UpdatePostAsync(id, post); if (userPostModel != null) { return(NoContent()); } return(NotFound()); }
public async Task <UserPost> UpdatePostAsync(Guid id, UserPostUpdateDto post) { var userPostModel = await _userPostRepository.GetPostModelByIdAsync(id); if (userPostModel == null) { return(userPostModel); } _mapper.Map(post, userPostModel); await _userPostRepository.UpdatePostAsync(userPostModel); return(userPostModel); }