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