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