From 0f8555721b8c224ad8f5483bc82911cefb65b786 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 19 Mar 2022 22:56:25 +0100 Subject: [PATCH] Fix trip sorting --- bahnplan.web/Pages/Index.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +