Skip to content

Instantly share code, notes, and snippets.

@sebastienlevert
Last active March 15, 2023 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastienlevert/527b2abdfa3b8cdd2558691788794cd4 to your computer and use it in GitHub Desktop.
Save sebastienlevert/527b2abdfa3b8cdd2558691788794cd4 to your computer and use it in GitHub Desktop.
using GitHubClient.ApiClient;
using Microsoft.Kiota.Abstractions.Authentication;
using Microsoft.Kiota.Http.HttpClientLibrary;
var authProvider = new AnonymousAuthenticationProvider();
var requestAdapter = new HttpClientRequestAdapter(authProvider);
var client = new GitHubApiClient(requestAdapter);
// Use the request builder pattern to get date from the API
var projects = await client.Orgs["microsoft"].Projects.GetAsync();
if(projects != null) {
foreach(var project in projects) {
Console.WriteLine($"Project {project?.Name} is available at {project?.HtmlUrl}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment