Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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"));
        }