Пример #1
0
        public AzureUserObject[] UsersByGroup(string authToken, string groupName)
        {
            var grp = GetGroupByName(authToken, groupName);

            if (grp == null)
            {
                return(new AzureUserObject[0]);
            }

            //var data = MsGraph.GetMembersByGroupUrl(grp.Id);
            var usrs = ExecuteGet <AzureUserObject[]>(authToken, MsGraph.GetMembersByGroupUrl(grp.Id)); // GraphResponse<AzureUserObject[]>.Parse(data);

            return(usrs.Value);
        }
Пример #2
0
        public async Task <AzureUserObject[]> UsersByGroupAsync(string authToken, string groupName)
        {
            var grp = await GetGroupByNameAsync(authToken, groupName);

            if (grp == null)
            {
                return(new AzureUserObject[0]);
            }

            var data = await MsGraph.GetMembersByGroupUrl(grp.Id).GetStringFromUrlAsync(
                requestFilter: req => { req.AddBearerToken(authToken); });

            var usrs = GraphResponse <AzureUserObject[]> .Parse(data);

            return(usrs.Value);
        }