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