Last active
March 29, 2022 14:11
-
-
Save MahdiKarimipour/120aa271eb0b8f05523ff3929982baf9 to your computer and use it in GitHub Desktop.
Pellerex Foundation, Azure DevOps, Fetch Projects
This file contains hidden or 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
public async Task<IEnumerable<ProjectViewModel>> GetProjects(string organisation) | |
{ | |
var url = $"https://dev.azure.com/{organisation}/_apis/projects?api-version=6.0"; | |
var (projects, response) = await apiCall.GetAsync<AzureDevOpsGetOrganisationProjectsResponseDto>( | |
url: url, | |
password: appSecrets.AzureDevOpsToken); | |
return projects.value.Select(p => new ProjectViewModel() | |
{ | |
Id = Guid.Parse(p.id), | |
Name = p.name | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment