public async Task <CommentsOutputDto> Update(CommentsUpdateDto commentsUpdateDto) { var tempComment = mapper.Map <Comment>(commentsUpdateDto); await commentRepository.Update(tempComment); await commentRepository.Save(); return(mapper.Map <CommentsOutputDto>(tempComment)); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } CommentsUpdateDto tempCommentUpdate = new CommentsUpdateDto(); tempCommentUpdate.Id = inputDto.Id; tempCommentUpdate.MovieId = inputDto.MovieId; await commentService.Update(tempCommentUpdate); return(RedirectToPage("../User/Index")); }