Esempio n. 1
0
        public ActionResult _OlderMicroblog(int pageIndex = 1, string tenantTypeId = "", MediaType?mediaType = null, bool?isOriginal = null, SortBy_Microblog sortBy = SortBy_Microblog.DateCreated)
        {
            //获取微博分页数据
            PagingDataSet <MicroblogEntity> microblogEntities = microblogService.GetPagings(pageIndex, tenantTypeId: TenantTypeIds.Instance().User(), sortBy: sortBy);

            //当第一次加载页面时获取当前页的最新一条微博的ID
            if (pageIndex == 1)
            {
                ViewData["lastMicroblogId"] = microblogEntities.OrderByDescending(m => m.MicroblogId).Select(m => m.MicroblogId).FirstOrDefault();
            }
            ViewData["pageCount"] = microblogEntities.PageCount;
            return(View("_NewMicroblogList", microblogEntities.AsEnumerable <MicroblogEntity>()));
        }