public async Task <bool> UserExistsAsync(string userId, CancellationToken cancellationToken = default) { if (string.IsNullOrEmpty(userId)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(userId)); } var exists = false; var api = await _restApiProvider.GetCheckUserExistsEndpointAsync(_appName, _hubName, userId); await _restClient.SendAsync(api, HttpMethod.Head, _productInfo, handleExpectedResponse : response => { switch (response.StatusCode) { case HttpStatusCode.OK: exists = true; return(true); case HttpStatusCode.NotFound: return(true); default: return(false); } }, cancellationToken : cancellationToken); return(exists); }