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