public IActionResult SetLabel([FromBody] SetLabelCommentParam param) { var s = SemEvalRepository.SetLabelComment(param).Result; if (!s) { return(BadRequest()); } return(Json(new { Message = "ثبت شد" })); }
public async Task <bool> SetLabelComment(SetLabelCommentParam param) { try { var comment = dBContext.Comments.Find(param.CommentId); if (comment == null) { return(false); } comment.CGOLD = param.Label; comment.LabelDate = DateTime.Now; dBContext.SaveChanges(); return(true); } catch (Exception) { return(false); } }