public PagedGraphGroups GetAllGroups() { VssConnection connection = Context.Connection; GraphHttpClient graphClient = connection.GetClient <GraphHttpClient>(); PagedGraphGroups groups = graphClient.GetGroupsAsync().Result; foreach (var group in groups.GraphGroups) { LogGroup(group); } return(groups); }
//================ VSTS graph api helper code =========================================================== private static GraphGroup GetGraphGroupFromString(GraphHttpClient graphClient, string groupDisplayname) { PagedGraphGroups groups = graphClient.GetGroupsAsync().Result; GraphGroup selectedGroup = null; foreach (var group in groups.GraphGroups) { if (group.DisplayName.Equals(groupDisplayName)) { return(selectedGroup = group); } } return(null); }