public IHttpActionResult Get(int id) { ReplyService service = CreateReplyService(); var reply = service.GetReplyById(id); return(Ok(reply)); }
public IHttpActionResult Get(int commentId) { ReplyService replyService = CreateReplyService(); var reply = replyService.GetReplyById(commentId); return(Ok(reply)); }
public async Task <IHttpActionResult> GetReplyById(int id) { ReplyService service = CreateReplyService(); ReplyDetail reply = await service.GetReplyById(id); return(Ok(reply)); }
public ActionResult Update(int?id) { //參數錯誤 if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //查無文章 var model = _replyService.GetReplyById(id.Value); if (model == null) { return(HttpNotFound()); } //已刪除文章不允許回覆 if (model.IsDel) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } return(View(model)); }