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