Пример #1
0
        public ActionResult Delete(string Id)
        {
            List <Landmark> landmarks = landmarkDAL.GetAllLandmarks();

            try
            {
                if (!landmarkDAL.DeleteLandmark(Id))
                {
                    //Set Failure Notificaton
                    Console.WriteLine("Failure");
                    return(View("Create", landmarks));
                }

                //Get Fresh landmarks
                landmarks = landmarkDAL.GetAllLandmarks();
                Console.WriteLine("Success");
            }
            catch (Exception)
            {
                //Set Error Message
            }
            return(View("Create", landmarks));
        }
 public IActionResult Delete(string id)
 {
     _landmarkDAL.DeleteLandmark(id);
     return(RedirectToAction("Neighborhoods", "Neighborhood"));
 }