예제 #1
0
        public IEnumerable <Topic> Get(bool includeReplies = false)
        {
            IQueryable <Topic> results;

            if (includeReplies == true)
            {
                results = _repo.GetTopicsIncludingReplies();
            }
            else
            {
                results = _repo.GetTopics();
            }

            var topics = results.OrderByDescending(t => t.Created)
                         .Take(25)
                         .ToList();

            return(topics);
        }
예제 #2
0
        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            var topics = _repo.GetTopics()
                         .OrderByDescending(t => t.Created)
                         .Take(25)
                         .ToList();

            return(View(topics));
        }