public IActionResult AddAssignmentComment([FromRoute] int assignmentId, [FromBody] AssignmentCommentAddDTO dto) { return(this.Created(() => { AssignmentCommentDTO comment = _Mapper.Map <AssignmentCommentAddDTO, AssignmentCommentDTO>(dto); comment.Author = User.Identity.Name; return _AssignmentRepo.AddComment(assignmentId, comment).Equals((int)TransactionStatus.SUCCESS) ? dto.ToJson() : new JObject(); })); }
public IActionResult AddAssignmentComment([FromRoute] int assignmentId, [FromBody] AssignmentCommentAddDTO dto) { return(this.Created(() => { var comment = _Mapper.Map <AssignmentCommentDTO>(dto); comment.Author = User.Identity.Name; return _AssignmentRepo.AddComment(assignmentId, comment).Equals(TransactionStatus.SUCCESS) ? dto : new AssignmentCommentAddDTO(); }, _Logger)); }