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