Ejemplo n.º 1
0
 public ActionResult Comment(int id)
 {
     if (IsAdmin())
     {
         ViewBag.IsAdmin = true;
     }
     else
     {
         ViewBag.IsAdmin = false;
     }
     return(PartialView("_CommentPartial", _logic.GetComments(id)));
 }
Ejemplo n.º 2
0
        public async Task <ActionResult <List <Comment> > > GetComments(int discussionid)
        {
            List <Comment> comments = await _forumLogic.GetComments(discussionid);

            if (comments == null)
            {
                return(StatusCode(404));
            }
            if (comments.Count == 0)
            {
                return(StatusCode(204));
            }
            StatusCode(200);
            return(comments);
        }