無論我試圖我無法設置一個用戶對象上的擴展屬性,這裏是可再現的一段代碼:根據提琴手天青架構擴展在圖形客戶端
public async Task CleanTest(string extName)
{
ExtensionProperty ep = new ExtensionProperty
{
Name = extName,
DataType = "String",
TargetObjects = { "User" }
};
App app = (App)(await _client.Applications.Where(a => a.AppId == _managementAppClientId).ExecuteSingleAsync());
app.ExtensionProperties.Add(ep);
await app.UpdateAsync();
GraphUser user = (GraphUser)(await _client.Users.Where(u => u.UserPrincipalName.Equals("email")).ExecuteSingleAsync());
string propName = FormatExtensionPropertyName(extName); //formats properly as extesion_xxx_name
user.SetExtendedProperty(propName, "testvalue");
//user.SetExtendedProperty(extName, "testvalue");
await user.UpdateAsync(); // fails here
}
user.UpdateAsync()不連走出去和應用失敗的異常:
「屬性‘extension_e206e28ff36244b19bc56c01160b9cf0_UserEEEqdbtgd3ixx2’上鍵入‘Microsoft.Azure.ActiveDirectory.GraphClient.Internal.User’不存在,請確保只使用由定義的屬性名稱。類型。」
太好了,我今天來試試吧。微軟是否意識到這個問題? ) –
好像其他人正在追蹤這個問題[這裏](https://github.com/Azure-Samples/active-directory-dotnet-graphapi-console/issues/28)。 –