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;
            }
        }
示例#2
0
 public async Task <IGitHubUser> GetAuthenticatedUser(string accessToken)
 {
     return(await _client.GetAsync <GitHubUser>(accessToken, "/user"));
 }
示例#3
0
 public Task <GitHubUser> GetUser(string name)
 {
     return(_client.GetAsync <GitHubUser>($@"users/{name}"));
 }