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