public async Task <IActionResult> OnGetAsync(long?id) { if (id == null) { return(NotFound()); } Car_Brands = await _context.Car_Brands.FirstOrDefaultAsync(m => m.ID == id); if (Car_Brands == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(long?id) { if (id == null) { return(NotFound()); } Car_Brands = await _context.Car_Brands.FindAsync(id); if (Car_Brands != null) { _context.Car_Brands.Remove(Car_Brands); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }