示例#1
0
        //blog archives
        public ActionResult Archives(int?id, int?page)
        {
            var vm   = new BlogVM();
            var repo = RepositoryFactory.CreateRepository();

            //TODO: See if this works for consolidating getting posts by tag id
            vm.BlogEntries = _blops.GetBlogArchives(id);

            var pageNumber = page ?? 1;

            // The 2nd param in the next line defines the size of the page
            vm.BlogEntries = vm.BlogEntries.ToPagedList(pageNumber, 5);

            vm.Tags = repo.GetAllTags();
            return(View(vm));
        }