public IActionResult OnPost(int whiskeyId) { var whiskey = whiskeyData.Delete(whiskeyId); whiskeyData.Commit(); if (whiskey == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{whiskey.Name} deleted"; return(RedirectToPage("./List")); }
public IActionResult OnPost(int WhiskeyId) { var whiskey = whiskeyData.Delete(WhiskeyId); return(RedirectToPage("./Index")); }