public async Task <IActionResult> UpdateComment([FromBody] UpdateCommentInputdto updateinput) { if (!ModelState.IsValid) { return(BadRequest()); } var result = await CommentServise.UpdateComment(updateinput); return(Ok(result)); }
public async Task <string> UpdateComment(UpdateCommentInputdto updateinput) { var comment = await FindComment(updateinput.CommentId); var text = comment.Text; comment = ChangeCommment(comment, updateinput.Text); if (comment.Text == text) { return("We don't have any change.."); } var result = CommentRepository.Update(comment); await CommentRepository.Save(); return(result); }