-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graph SDK V5: _graphClient.DeviceAppManagement.MobileApps[appId].PatchAsync(mobileApp) throw an Exception #699
Comments
I suspect that this may be caused by the API return type being abstract i.e. Any chance you have any change if you something like this? var mobileApp = await _graphClient.DeviceAppManagement.MobileApps[appId].GetAsync();
var win32LobApp = new Win32LobApp{ Description = "New Description"}; // use a derived instance
await _graphClient.DeviceAppManagement.MobileApps[appId].PatchAsync(win32LobApp); |
Thanks for your feedback. It works as long as I don’t try to PATCH navigation properties (like Categories).
How can I PATCH the Categories property? Thanks. |
The correct way to read/delete/update the categories is through the methods outlined in the documentation at https://learn.microsoft.com/en-us/graph/api/resources/intune-apps-mobileappcategory?view=graph-rest-1.0#methods |
Thanks for your feedback. Unfortunately, the link you provide describes how to work with Categories. What I want is to add a Category to a MobileApp. So, PATCH the Categories property of the Win32LobApp class. var requestInfo = new RequestInformation()
{
HttpMethod = Method.POST,
URI = new Uri($"{_graphClient.RequestAdapter.BaseUrl}/deviceAppManagement/mobileApps/{appId}/categories/$ref"),
};
requestInfo.SetContentFromParsable(_graphClient.RequestAdapter, "application/json", new CategoryId(categoryId));
await _graphClient.RequestAdapter.SendNoContentAsync(requestInfo, _errorMapping, default); |
Thanks for clearing this up. To confirm what you are saying is that the SDK is missing a path to call the path |
To my knowledge, there is no documentation about that.
Can we get the same for Categories? |
@DCourtel Just to recap what you are saying is that we need
Any chance this has been captured correctly? |
@andrueastman, 3. The HTTP verb would be DELETE not POST. |
No description provided. |
Thanks. We've created microsoftgraph/msgraph-metadata#510 so that the metadata can be updated so that the paths can be looked into in the metadata used to generated the SDK. |
I try to update a property of a MobileApp using PatchAsync and receive an Exception: ModelValidationFailure with message: Exception has been thrown by the target of an invocation.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: