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