public async Task <IEntry <GitHubContact> > FetchAsync(ulong id)
        {
            try
            {
                return(_entryFactory.Create(
                           await _client.GetAsync <GitHubContact>($"user/{id}")
                           ));
            }
            catch (GitHubException e)
            {
                if (e.Response.StatusCode == HttpStatusCode.NotFound)
                {
                    throw new ContactNotFoundException <GitHubContact>(e);
                }

                throw;
            }
        }
Beispiel #2
0
 public async Task <IGitHubUser> GetAuthenticatedUser(string accessToken)
 {
     return(await _client.GetAsync <GitHubUser>(accessToken, "/user"));
 }
Beispiel #3
0
 public Task <GitHubUser> GetUser(string name)
 {
     return(_client.GetAsync <GitHubUser>($@"users/{name}"));
 }