mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 12:32:03 -04:00
Try and avoid weird tracking issues with the exclude command
This commit is contained in:
@@ -225,7 +225,7 @@ public static class Money
|
|||||||
throw new Exception($"User ID {userId} not found");
|
throw new Exception($"User ID {userId} not found");
|
||||||
}
|
}
|
||||||
var gambler =
|
var gambler =
|
||||||
await db.Gamblers.OrderBy(x => x.Id).Include(x => x.User).LastOrDefaultAsync(g => g.User.Id == user.Id && g.State != GamblerState.PermanentlyBanned,
|
await db.Gamblers.AsNoTracking().OrderBy(x => x.Id).Include(x => x.User).LastOrDefaultAsync(g => g.User.Id == user.Id && g.State != GamblerState.PermanentlyBanned,
|
||||||
cancellationToken: ct);
|
cancellationToken: ct);
|
||||||
_logger.Info($"Retrieved entity for {user.KfUsername}. Is Gambler Entity Null? => {gambler == null}");
|
_logger.Info($"Retrieved entity for {user.KfUsername}. Is Gambler Entity Null? => {gambler == null}");
|
||||||
if (gambler != null)
|
if (gambler != null)
|
||||||
@@ -249,7 +249,7 @@ public static class Money
|
|||||||
NextVipLevelWagerRequirement = Money.VipLevels[0].BaseWagerRequirement
|
NextVipLevelWagerRequirement = Money.VipLevels[0].BaseWagerRequirement
|
||||||
}, ct);
|
}, ct);
|
||||||
await db.SaveChangesAsync(ct);
|
await db.SaveChangesAsync(ct);
|
||||||
var newEntity = await db.Gamblers.OrderBy(x => x.Id).Include(x => x.User)
|
var newEntity = await db.Gamblers.AsNoTracking().OrderBy(x => x.Id).Include(x => x.User)
|
||||||
.LastOrDefaultAsync(g => g.User == user, cancellationToken: ct);
|
.LastOrDefaultAsync(g => g.User == user, cancellationToken: ct);
|
||||||
if (newEntity == null)
|
if (newEntity == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user