// GET: Place public ActionResult Index() { var model = new PlaceListViewModel(); model.PageTitle = "List of places - Mowido"; model.Header = "List of places"; model.Places = _context.PlaceRepository.GetAll().ToList(); return(View(model)); }
// GET: Place public IActionResult Index(int page = 1) { int pageSize = 3; var source = _placeService.GetPlaces(); var count = source.Count; var items = source.Skip((page - 1) * pageSize).Take(pageSize).ToList(); PageViewModel pageViewModel = new PageViewModel(count, page, pageSize); PlaceListViewModel viewModel = new PlaceListViewModel { PageViewModel = pageViewModel, Places = items }; return(View(viewModel)); }
public PlaceListPage() { InitializeComponent(); BindingContext = _viewModel = App.Current.Services.GetService <PlaceListViewModel>(); }