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