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;
            }
        }
Esempio n. 2
0
 public bool Delete(int id)
 {
     return(locationData.Delete(id));
 }