public async ValueTask HandleAsync(Connect connect, CancellationToken cancellationToken) { var characterBelongsToCurrentProfile = await _charactersClient.BelongsToCurrentProfileAsync(connect.ClientId, cancellationToken) .ConfigureAwait(false); if (!characterBelongsToCurrentProfile) { throw new UnauthorizedAccessException($"Character {connect.ClientId} does not belong to current profile."); } }
public ValueTask <bool> CharacterBelongsToCurrentProfileAsync(string characterId, CancellationToken cancellationToken) { return(_charactersClient.BelongsToCurrentProfileAsync(characterId, cancellationToken)); }