public IActionResult Delete(string id) { if (!trainService.HasWithId(id)) { return(Redirect("/Home/Index")); } trainService.Delete(id); return(Redirect("/Home/Index")); }