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