Exemple #1
0
        public IActionResult DeleteTrain(int id)
        {
            var train = _train.GetTrain(id);

            if (train.TrainId == id)
            {
                _train.DeleteTrain(id);
                return(Ok());
            }

            else
            {
                return(NotFound($"Train with id {id} was not found"));
            }
        }
 public ActionResult DeleteTrain(int id)
 {
     _trainService.DeleteTrain(id);
     return(RedirectToAction("ShowTrains"));
 }