Fix trip sorting

This commit is contained in:
Laura Hausmann 2022-03-19 22:56:25 +01:00
parent f8a0df9a88
commit 0f8555721b
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -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();
<tr>
<td>
@ -98,4 +98,4 @@
</div>
</div>
}
</div>
</div>