continuity/Server/PacketHandlers/CharacterCreationHandler.CompiledQueries.cs

15 lines
490 B
C#
Raw Normal View History

2023-11-24 19:04:42 +00:00
// Copyright (c) 2023 Timothy Schenk. Subject to the GNU AGPL Version 3 License.
using Microsoft.EntityFrameworkCore;
using Server.DB;
using Server.DB.Documents;
namespace Server.PacketHandlers;
public partial class CharacterCreationHandler
{
private static readonly Func<WonderkingContext, Guid, Task<Account>> _getAccount =
EF.CompileQuery((WonderkingContext context, Guid accountId) =>
context.Accounts.FirstOrDefaultAsync(a => a.Id == accountId, default));
}