Пример #1
0
        public IActionResult Index(int?pageNumber)
        {
            var guests = _guestService.GetByEmail(User.Identity.Name).Select(guest => new GuestIndexViewModel
            {
                Id           = guest.Id,
                FirstName    = guest.FirstName,
                LastName     = guest.LastName,
                MobileNo     = guest.MobileNo,
                RoomType     = guest.RoomType,
                FromDate     = guest.FromDate,
                ToDate       = guest.ToDate,
                CheckedIn    = guest.CheckedIn,
                TotalCharges = Math.Round(guest.TotalCharges, 2),
                Email        = guest.Email
            }).ToList();
            int pageSize = 3;

            return(View(BookingListPagination <GuestIndexViewModel> .Create(guests, pageNumber ?? 1, pageSize)));
        }