public IEnumerable <Comment> GetComments(int caseId) { if (caseId <= 0) { throw new DoesNotExistException(typeof(Case)); } return(commentData.GetComments(caseId)); }
public IActionResult Details(int id) { var article = _articleData.GetArticle(id); //var comments = _commentData.GetComments(id).ToList(); //var pagedList = PagingList.Create(comments, 2, page); var model = new ArticeViewModel(); model.Id = id; model.Title = article.Title; model.Author = article.Author; model.Category = article.Category; model.Comments = _commentData.GetComments(id).ToList(); model.Date = article.Date; model.Content = article.Content; ViewData["Id"] = model.Id.ToString(); return(View(model)); }