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