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

            if (replies == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok(replies));
            }
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 public IEnumerable <Reply> Get(int topicId)
 {
     return(_repo.GetRepliesByTopic(topicId));
 }