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")); }
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()); }