From 68f14fe5910af86019df6619a74789b50a92bb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cecilia=20Wir=C3=A9n?= Date: Sun, 15 Sep 2024 11:32:18 +0200 Subject: [PATCH] Refactor ConferenceService to order rooms by priority when including them (#80) --- ConferenceService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConferenceService.cs b/ConferenceService.cs index 1bef3bc..49a4286 100644 --- a/ConferenceService.cs +++ b/ConferenceService.cs @@ -18,7 +18,7 @@ public ConferenceService(SwetuggContext context, IMemoryCache cache) public Conference? Get(string slug) => ReadThroughCache($"conference-{slug.ToLower()}", () => _context.Conferences .AsSplitQuery() - .Include(c => c.Rooms) + .Include(c => c.Rooms.OrderBy(c => c.Priority)) .Include(c => c.Sessions.Where(s => s.Published)) .ThenInclude(c => c.Speakers.Where(s => s.Published)) .ThenInclude(s => s.SpeakerImages)