public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } User = await _context.User.FindAsync(id); if (User != null) { _context.User.Remove(User); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } ElementKey = await _context.ElementKey.FindAsync(id); if (ElementKey != null) { _context.ElementKey.Remove(ElementKey); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index", new { id = ElementKey.ElementTypeID })); }