Beispiel #1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CarBookingz = await _context.CarBookingz.FindAsync(id);

            if (CarBookingz != null)
            {
                _context.CarBookingz.Remove(CarBookingz);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CarBookingz = await _context.CarBookingz
                          .Include(c => c.ApplicationUser)
                          .Include(c => c.Car)
                          .Include(c => c.Status).FirstOrDefaultAsync(m => m.Id == id);

            if (CarBookingz == null)
            {
                return(NotFound());
            }
            return(Page());
        }