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