📅  最后修改于: 2022-03-11 14:56:53.489000             🧑  作者: Mango
private static async Task GetUserGroupsAsync(HttpClient client, string user)
{
var payload = await client.GetStringAsync(
$"https://graph.microsoft.com/v1.0/users/{user}/memberOf");
var obj = JsonConvert.DeserializeObject(payload);
var groupDescription = from g in obj["value"]
select g["displayName"].Value();
return groupDescription.ToArray();
}