mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Forgot that LastOrDefault needs an OrderBy
This commit is contained in:
@@ -86,6 +86,7 @@ public class BlackjackCommand : ICommand
|
|||||||
|
|
||||||
// Check for existing incomplete blackjack game
|
// Check for existing incomplete blackjack game
|
||||||
var existingGame = await _dbContext.Wagers
|
var existingGame = await _dbContext.Wagers
|
||||||
|
.OrderBy(x => x.Id)
|
||||||
.LastOrDefaultAsync(w => w.Gambler.Id == gambler.Id &&
|
.LastOrDefaultAsync(w => w.Gambler.Id == gambler.Id &&
|
||||||
w.Game == WagerGame.Blackjack &&
|
w.Game == WagerGame.Blackjack &&
|
||||||
!w.IsComplete && w.GameMeta != null,
|
!w.IsComplete && w.GameMeta != null,
|
||||||
@@ -157,6 +158,7 @@ public class BlackjackCommand : ICommand
|
|||||||
|
|
||||||
// Update wager ID in game state
|
// Update wager ID in game state
|
||||||
var createdWager = await _dbContext.Wagers
|
var createdWager = await _dbContext.Wagers
|
||||||
|
.OrderBy(x => x.Id)
|
||||||
.LastOrDefaultAsync(
|
.LastOrDefaultAsync(
|
||||||
w => w.Gambler.Id == gambler.Id && w.Game == WagerGame.Blackjack && !w.IsComplete && w.GameMeta != null,
|
w => w.Gambler.Id == gambler.Id && w.Game == WagerGame.Blackjack && !w.IsComplete && w.GameMeta != null,
|
||||||
cancellationToken: ctx) ?? throw new InvalidOperationException();
|
cancellationToken: ctx) ?? throw new InvalidOperationException();
|
||||||
@@ -200,6 +202,7 @@ public class BlackjackCommand : ICommand
|
|||||||
|
|
||||||
// Find active game
|
// Find active game
|
||||||
var activeWager = await _dbContext.Wagers
|
var activeWager = await _dbContext.Wagers
|
||||||
|
.OrderBy(x => x.Id)
|
||||||
.LastOrDefaultAsync(w => w.Gambler.Id == gambler.Id &&
|
.LastOrDefaultAsync(w => w.Gambler.Id == gambler.Id &&
|
||||||
w.Game == WagerGame.Blackjack &&
|
w.Game == WagerGame.Blackjack &&
|
||||||
!w.IsComplete && w.GameMeta != null, cancellationToken: ctx);
|
!w.IsComplete && w.GameMeta != null, cancellationToken: ctx);
|
||||||
|
|||||||
Reference in New Issue
Block a user