public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } People = await _context.People .Include(p => p.PeopleType).FirstOrDefaultAsync(m => m.PersonId == id); if (People == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } People = await _context.People .Include(p => p.PeopleType).FirstOrDefaultAsync(m => m.PersonId == id); if (People == null) { return(NotFound()); } ViewData["PeopleTypeId"] = new SelectList(_context.PeopleTypes, "PeopleTypeId", "PeopleTypeDesc"); return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } People = await _context.People.FindAsync(id); if (People != null) { _context.People.Remove(People); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }