public IEnumerable <Reply> Get(int topicId)
 {
     return(_messageBoardRepository.GetRepliesByTopic(topicId)
            .OrderByDescending(r => r.Created)
            .Take(5)
            .ToList());
 }
Beispiel #2
0
        public IHttpActionResult Get(int topicId)
        {
            var replies = _repo.GetRepliesByTopic(topicId);

            if (replies == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok(replies));
            }
        }
        public ActionResult Index()
        {
            var topics = _repo.GetTopics()
                         .OrderByDescending(t => t.Created)
                         .Take(25)
                         .ToList();


            foreach (var topic in topics)
            {
                topic.Replies = _repo.GetRepliesByTopic(topic.Id).ToList();
            }

            return(View(topics));
        }
 public IEnumerable <Reply> Get(int topicId)
 {
     return(_repo.GetRepliesByTopic(topicId));
 }