Holy shit EF Core tracking is pissing me off so much now

This commit is contained in:
barelyprofessional
2025-10-05 14:25:59 -05:00
parent 494b118969
commit c6658bae1f

View File

@@ -51,8 +51,9 @@ public class TempExcludeCommand : ICommand
$"{user.FormatUsername()}, {targetUser.KfUsername} can't be excluded as he's banned.", true);
return;
}
targetGambler = await db.Gamblers.FirstOrDefaultAsync(x => x.Id == targetGambler.Id, cancellationToken: ctx);
var activeExclusion = await Money.GetActiveExclusionAsync(targetGambler.Id, ctx);
var activeExclusion = await Money.GetActiveExclusionAsync(targetGambler!.Id, ctx);
if (activeExclusion != null)
{
var length = DateTimeOffset.UtcNow - activeExclusion.Expires;