示例#1
0
 public ActionResult <bool> Delete(int id)
 {
     try
     {
         return(Ok(_service.Delete(id)));
     }
     catch (System.Exception error)
     {
         return(BadRequest(error.Message));
     }
 }
        public ActionResult Delete(int? id)
        {
            CitiesService citiesService = new CitiesService();

            if (!id.HasValue)
            {
                return RedirectToAction("List");
            }

            citiesService.Delete(id.Value);

            return RedirectToAction("List");
        }