microsoftgraph / msgraph-sdk-dotnet

Microsoft Graph Client Library for .NET!
https://graph.microsoft.com
Other
699 stars 247 forks source link

concrete OmaSettings objects dont send the odata type in the request #294

Closed BjornMer closed 6 years ago

BjornMer commented 6 years ago

Actual behavior

When i make a call to add a device configuration, and this configuration has some concrete OmaSettings (ie OmaSettingInteger), I get an error saying that "value" is not a property of omaSetting.

Steps to reproduce the behavior

var omasettingServicedeskGroup = new OmaSettingInteger { DisplayName = "Local Account", OmaUri = "./Device/Vendor/MSFT/Accounts/Users/Servicedesk/LocalUserGroup/", Value = 2 //add here working additional data }; localUserAccounts.OmaSettings = new List { omasettingServicedeskGroup }; graphClient.DeviceManagement.DeviceConfigurations.Request().AddAsync(localUserAccounts);

Expected behavior

To fix this in the code i have to send the odata.type as additional data, this should be actually done by the code itself,. The OmaSettingInteger should set its own odata.type . replace comment with this: AdditionalData = new Dictionary<string, object> { { "@odata.type", "microsoft.graph.omaSettingInteger" } }

MIchaelMainer commented 6 years ago

877881 - Investigate whether the service is compliant or whether the client generation is faulty.

MIchaelMainer commented 6 years ago

@BjornMer This fix will go out with the next update which should be end of October. Thank you for pointing this out to us!