From 4ccb6b7865fc96493c3d6929de50afb74b3dbc7d Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Fri, 2 Jan 2026 21:28:59 -0600 Subject: [PATCH] Forgot that LastOrDefault needs an OrderBy --- KfChatDotNetBot/Commands/Kasino/BlackjackCommand.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/KfChatDotNetBot/Commands/Kasino/BlackjackCommand.cs b/KfChatDotNetBot/Commands/Kasino/BlackjackCommand.cs index 6abe31a..ff0be81 100644 --- a/KfChatDotNetBot/Commands/Kasino/BlackjackCommand.cs +++ b/KfChatDotNetBot/Commands/Kasino/BlackjackCommand.cs @@ -86,6 +86,7 @@ public class BlackjackCommand : ICommand // Check for existing incomplete blackjack game var existingGame = await _dbContext.Wagers + .OrderBy(x => x.Id) .LastOrDefaultAsync(w => w.Gambler.Id == gambler.Id && w.Game == WagerGame.Blackjack && !w.IsComplete && w.GameMeta != null, @@ -157,6 +158,7 @@ public class BlackjackCommand : ICommand // Update wager ID in game state var createdWager = await _dbContext.Wagers + .OrderBy(x => x.Id) .LastOrDefaultAsync( w => w.Gambler.Id == gambler.Id && w.Game == WagerGame.Blackjack && !w.IsComplete && w.GameMeta != null, cancellationToken: ctx) ?? throw new InvalidOperationException(); @@ -200,6 +202,7 @@ public class BlackjackCommand : ICommand // Find active game var activeWager = await _dbContext.Wagers + .OrderBy(x => x.Id) .LastOrDefaultAsync(w => w.Gambler.Id == gambler.Id && w.Game == WagerGame.Blackjack && !w.IsComplete && w.GameMeta != null, cancellationToken: ctx);