refactor: async query

This commit is contained in:
Timothy Schenk 2023-11-20 19:51:33 +01:00
parent 55e7e8fc4c
commit 157dbbc2f5

View file

@ -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<LoginInfoPacket>
{
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)
{