Fetch GUID directly and make it non async (#14358)

This commit is contained in:
Mole
2023-06-08 14:49:52 +02:00
committed by GitHub
parent c84a3e2fe4
commit 64c7c6b439

View File

@@ -85,10 +85,8 @@ internal sealed class UserIdKeyResolver : IUserIdKeyResolver
.From<UserDto>()
.Where<UserDto>(x => x.Id == id);
string? guidString = await scope.Database.ExecuteScalarAsync<string?>(query);
Guid fetchedKey = guidString is not null
? new Guid(guidString)
: throw new InvalidOperationException("No user found with the specified id");
Guid fetchedKey = scope.Database.ExecuteScalar<Guid?>(query)
?? throw new InvalidOperationException("No user found with the specified id");
_idToKey[id] = fetchedKey;