public async Task<IActionResult> OnPostAsync(int id) { Earring = _earringService.GetEarring(id); await _earringService.DeleteEarringAsync(Earring.JewelryID); return RedirectToPage("AllEarrings"); }
public IActionResult OnGet(int id) { Earring = _earringService.GetEarring(id); if (Earring == null) { RedirectToPage("/NotFound"); } return Page(); }