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