【问题标题】:Unable to expand MemberOf using Microsoft Graph .NET SDK using Delta Query无法使用 Delta Query 使用 Microsoft Graph .NET SDK 扩展 MemberOf
【发布时间】:2017-12-07 18:37:40
【问题描述】:

使用 Delta 查询时,扩展属性似乎不起作用。它适用于常规用户查询。

这是 Microsoft Graph API 的限制吗?

var usersInfo = graphServiceClientWithApplicationPermission.Users.Delta().Request().Expand("MemberOf").GetAsync();

// Add inital request users
foreach (var userInfo in usersInfo)
{

    // Member info doesn't seem to be expanded even if $expand=MemberOf is sent
    if (userInfo.MemberOf == null)
    {
        userInfo.MemberOf = await applicationPermissionsClient.Users[userInfo.Id].MemberOf.Request().GetAsync();
    }

    // MemberOf is now populated ??

}

【问题讨论】:

    标签: microsoft-graph-api


    【解决方案1】:

    似乎这是 Microsoft Graph 的另一个限制,不受支持。

    可选查询参数

    如果客户端使用查询参数,则必须在 初始请求。 Microsoft Graph 自动编码指定的 参数到响应中提供的 nextLink 或 deltaLink 中。这 调用应用程序只需要指定他们想要的查询 参数一次。 Microsoft Graph 添加指定参数 自动为所有后续请求。对于用户和组,t 以下是使用某些查询参数的限制:

    如果使用 $select 查询参数,该参数表示 客户更喜欢只跟踪属性的更改或 $select 语句中指定的关系。如果发生变化 到未选择的属性,该资源为其 属性更改后不会出现在增量响应中 后续请求。不支持 $expand。

    对于用户和组 beta(预览版)API,范围过滤器允许您 按 objectId 跟踪对一个或多个特定用户或组的更改。为了 例如,以下请求: https://graph.microsoft.com/beta/groups/delta/?$filter= id eq '477e9fc6-5de7-4406-bb2a-7e5c83c9ae5f' 或 id eq '004d6a07-fe70-4b92-add5-e6e37b8acd8e' 返回组的更改 匹配查询过滤器中指定的 id。

    https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_overview

    【讨论】:

      猜你喜欢
      • 2021-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多