public virtual async Task <IActionResult> OnPostAsync() { var dto = ObjectMapper.Map <CreateEditCommentViewModel, CreateUpdateCommentDto>(ViewModel); await _service.UpdateAsync(Id, dto); return(NoContent()); }
public async Task Should_Update_A_Comment() { var newContent = "new content"; var oldComment = (await _commentRepository.GetListAsync()).FirstOrDefault();; await _commentAppService.UpdateAsync(oldComment.Id, new UpdateCommentDto() { Text = newContent }); UsingDbContext(context => { var comment = context.Comments.FirstOrDefault(q => q.Id == oldComment.Id); comment.Text.ShouldBe(newContent); }); }
public Task <CommentWithDetailsDto> UpdateAsync(Guid id, UpdateCommentDto input) { return(_commentAppService.UpdateAsync(id, input)); }
public async Task Update(Guid id, UpdateCommentDto commentDto) { await _commentAppService.UpdateAsync(id, commentDto); }
public Task <CommentDto> UpdateAsync(Guid id, CreateUpdateCommentDto input) { return(_service.UpdateAsync(id, input)); }