Beispiel #1
0
        public IActionResult All(int id = 1)
        {
            const int ItemsPerPage = 10;
            var       viewModel    = new HikesListInputModel
            {
                PageNumber     = id,
                ColectionCount = this.hikesService.GetCount(),
                Hikes          = this.hikesService.GetAll <HikeInListInputModel>(id, ItemsPerPage),
                ItemsPerPage   = ItemsPerPage,
            };

            return(this.View(viewModel));
        }
Beispiel #2
0
        public IActionResult ById(int id)
        {
            var hike = this.hikesService.GetById <SingleHikeViewModel>(id);

            var hikes = new HikesListInputModel
            {
                PageNumber     = id,
                ColectionCount = this.hikesService.GetCount(),
                Hikes          = this.hikesService.GetAll <HikeInListInputModel>(1, this.hikesService.GetCount()),
                ItemsPerPage   = 10,
            };

            MainHikeViewModel mainLandmarkView = new MainHikeViewModel
            {
                SingleHikeView = hike,
                HikesListInput = hikes,
            };

            return(this.View(mainLandmarkView));
        }