为什么要“ Microsoft.graph.user.additionaldata”属性包含经理信息?

发布于 2025-01-22 20:33:42 字数 363 浏览 2 评论 0原文

在Microsoft.graph.user对象中,有一个名为“额外数据”的字段。 从告诉记录是否是三角记录到存储管理器信息,看来这可以容纳许多值。

在这种情况下,它包含有关用户经理的信息。 看起来它可以保存多个记录,因此我问从该属性获取数据的最佳方法是什么,以确保我获得它可能拥有的所有值。

我也不确定为什么经理信息在附加属性中而不是在Manager属性中。

Within the Microsoft.Graph.User object there is a field called "AdditionalData".
It seems this can hold many values, from telling if a record is a delta record to storing manager information.

enter image description here

In this instance, it holds information on a users manager.
It looks like it can hold multiple records however, so I am asking what is the best way to get data from this property, to ensure I get all values it might have.

I am also unsure why manager information is in the AdditionalData property and not in the Manager property.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长亭外,古道边 2025-01-29 20:33:42

是的,您是正确的附加数据可能会保存多个记录,您可以向用户添加额外的记录,这些记录可以根据您的自定义保存任何信息。

您可以使用OpenXtension Trick将多个值添加到额外的Data中,

就是添加这样的扩展名

extension = new OpenTypeExtension
                {
                    ExtensionName = AzureADExtensions.UserConstants.ExtensionName,
                    AdditionalData = new Dictionary<string, object>
                    {
                        {"OtherEmail", externalUser.Email},
                        {"OtherRole" , externalUser.Roles.FirstOrDefault()}
                    }
                };

                await _graphClient.Users[user.Id].Extensions.Request()
                    .AddAsync(extension);

,然后像这样检索它们。

user = await _graphClient
                    .Users[userId]
                    .Request()
                    .GetAsync();
// Note : you should be able to expand this on original request, but fails for me.
                var extensions = await _graphClient.Users[user.Id].Extensions.Request().GetAsync();
                user.Extensions = extensions;

参考:针对用户

Yes you are correct AdditionalData may hold multiple record,You can add additionalData to your user that can hold any information based on your customization.

you can add the multiple value to additionalData using Openxtension

Trick is to add the extensions like this

extension = new OpenTypeExtension
                {
                    ExtensionName = AzureADExtensions.UserConstants.ExtensionName,
                    AdditionalData = new Dictionary<string, object>
                    {
                        {"OtherEmail", externalUser.Email},
                        {"OtherRole" , externalUser.Roles.FirstOrDefault()}
                    }
                };

                await _graphClient.Users[user.Id].Extensions.Request()
                    .AddAsync(extension);

And then retrieve them like this.

user = await _graphClient
                    .Users[userId]
                    .Request()
                    .GetAsync();
// Note : you should be able to expand this on original request, but fails for me.
                var extensions = await _graphClient.Users[user.Id].Extensions.Request().GetAsync();
                user.Extensions = extensions;

Reference : Azure AD GraphServiceClient can't set AdditionalData against User

心碎的声音 2025-01-29 20:33:42

“附加数据”属性仅在进行Delta查询时才保留Manager信息,如果我们进行常规查询,则必须使用扩展属性来获取经理。

我们目前避免出于时间的利益而避免使用三角洲查询,但可能会在另一点回到它。

谢谢大家。

The "Additional Data" property only holds manager info if we do a delta query, if we do a regular query, we have to use extended properties to get the manager.

We are avoiding delta query for the moment in the interests of time but might come back to it at another point.

Thanks all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文