From 157dbbc2f547c3543233d640f49732a4e57dae5b Mon Sep 17 00:00:00 2001 From: Timothy Schenk Date: Mon, 20 Nov 2023 19:51:33 +0100 Subject: [PATCH] refactor: async query --- Server/PacketHandlers/LoginHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/PacketHandlers/LoginHandler.cs b/Server/PacketHandlers/LoginHandler.cs index 62a05a8..1681460 100644 --- a/Server/PacketHandlers/LoginHandler.cs +++ b/Server/PacketHandlers/LoginHandler.cs @@ -1,6 +1,7 @@ using System.Security.Cryptography; using System.Text; using Konscious.Security.Cryptography; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using NetCoreServer; @@ -30,7 +31,7 @@ public class LoginHandler : IPacketHandler { LoginResponseReason loginResponseReason; _logger.LoginData(packet.Username, packet.Password); - var account = _wonderkingContext.Accounts.FirstOrDefault(a => a.Username == packet.Username); + var account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username).ConfigureAwait(false); if (account == null) {