public IActionResult Index() { LinesIndexViewModel model = new LinesIndexViewModel() { Lines = lineService.GetAll().Select(l => new LineIndexViewModel() { ArrivalTime = l.ArrivalTime.ToString("hh:mm"), Date = l.Date.ToString("MM/dd/yyyy"), Departure = l.Departure, DepartureTime = l.DepartureTime.ToString("hh:mm"), Destination = l.Destination, TrainNumber = trainService.GetById(l.TrainId).Number, LineId = l.Id }).ToList() }; return(View(model)); }
// // GET: /Platform/City/Details/5 public ActionResult Details(object id) { var item = _trainService.GetById(id); return(View(item)); }
public IActionResult Delete(Guid id) { trainService.Delete(trainService.GetById(id)); return(RedirectToAction("Index")); }