public IActionResult OnPost(int locationId) { try { var location = locationData.Delete(locationId); locationData.Commit(); if (location == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{location.Name} wurde gelöscht!"; return(RedirectToPage("./List")); } catch (Exception) { throw; } }
public bool Delete(int id) { return(locationData.Delete(id)); }