diff --git a/bahnplan.web/Pages/Index.cshtml b/bahnplan.web/Pages/Index.cshtml index a2f9071..5b0d510 100644 --- a/bahnplan.web/Pages/Index.cshtml +++ b/bahnplan.web/Pages/Index.cshtml @@ -40,7 +40,7 @@ trips = db.Trips.Where(p => p.UserId == Model.AuthorizedUser.UserId).ToList(); } - foreach (var trip in trips.OrderBy(p => db.Legs.First(a => a.TripId == p.TripId).DepTime)) { + foreach (var trip in trips.OrderBy(p => db.Legs.Where(a => a.TripId == p.TripId).OrderBy(leg => leg.DepTime).First().DepTime)) { var legs = db.Legs.Where(p => p.TripId == trip.TripId).OrderBy(p => p.DepTime).ToList(); @@ -98,4 +98,4 @@ } - \ No newline at end of file +