Last active
May 22, 2020 00:29
-
-
Save josephwoodward/4b2f4abdbabc58ca63dbc53f634b3df2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiController] | |
[Route("api/[controller]")] | |
public class ReposController : Controller | |
{ | |
private readonly IGitHub _github; | |
public ReposController(IGitHub github) | |
{ | |
_github = github; | |
} | |
[HttpGet] | |
public async Task<ICollection<string>> Get() | |
{ | |
var repositories = await _github.GetRepositoriesAsync("weyland-yutani", count: 10); | |
var names = repositories.Select(repository => repository.Name).ToList(); | |
names.Sort(); | |
return names; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment