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