public ActionResult Index(NewsExsPagingFilteringModel command)
 {
     if (command.PageNumber <= 0) command.PageNumber = 1;
     var model = new NewsExIndexModel();
     var newsExs = _newsExService.GetAllNewsExs(pageIndex: command.PageNumber - 1, pageSize: 10);
     model.NewsExs = newsExs.Select(q =>
     {
         var project = q.ToModel();
         project.PictureModel = new PictureModel
         {
             ImageUrl = _pictureService.GetPictureUrl(q.PictureId, 290),
             FullSizeImageUrl = _pictureService.GetPictureUrl(q.PictureId)
         };
         return project;
     }).ToList();
     model.PagingFilteringContext.LoadPagedList(newsExs);
     return View(model);
 }
Esempio n. 2
0
 public NewsExIndexModel()
 {
     PagingFilteringContext = new NewsExsPagingFilteringModel();
 }