Пример #1
0
        public async Task <IActionResult> Index(int page = 1)
        {
            var view = new NewsItemListViewModel
            {
                News       = _newsViewModelService.ListByPage(PageSize, page),
                PagingInfo = new PagingInfo
                {
                    CurrentPage  = page,
                    ItemsPerPage = PageSize,
                    TotalItems   = _newsViewModelService.GetAllCount()
                },
            };

            ViewBag.ReturnUrl = Request.Path;
            return(View(view));
        }
Пример #2
0
 public NewsItemListPage()
 {
     InitializeComponent();
     _viewModel     = new NewsItemListViewModel(Navigation);
     BindingContext = _viewModel;
 }