예제 #1
0
        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);
        }
예제 #2
0
        //================ 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);
        }