public IResult UpdateArticleComment(UpdateArticleCommentDto updateArticleCommentDto) { var user = _authService.GetAuthenticatedUser().Result.Data; var articleComment = _uow.ArticleComments.Get(x => x.Id == updateArticleCommentDto.ArticleCommentId); var errorResult = BusinessRules.Run(CheckAuthenticatedUserExist(), IsArticleCommentExist(updateArticleCommentDto.ArticleCommentId), IsArticleCommentBelongToUser(user.Id, articleComment.Id)); articleComment.Comment = updateArticleCommentDto.Comment; _uow.ArticleComments.Update(articleComment); _uow.Commit(); return(new SuccessResult(Message.ArticleCommentUpdated)); }
public IActionResult Comments(UpdateArticleCommentDto updateArticleCommentDto) { var result = this._articleService.UpdateArticleComment(updateArticleCommentDto); if (result.ResultType == ResultType.UnAuthorized) { return(Unauthorized()); } if (result.ResultType == ResultType.Success) { return(Ok(result.Message)); } return(BadRequest(result.Message)); }