-
Notifications
You must be signed in to change notification settings - Fork 252
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
Cannot process input of abstract type 'microsoft.graph.extension' #2516
Comments
Thanks for raising this @vknht Any chance you get a different result if you do something like this? var extension = new OpenTypeExtension();
extension.AdditionalData["MyProperty"] = "MyNewValue";
await graphClient.Me.ContactFolders["MyContactFolderId"].Contacts["MyContactId"].Extensions["MyExtension"].PatchAsync(extension); |
Hi, this is interesting. If I do something like this:
it works. "OdataType" is the same on both instances: "#microsoft.graph.openTypeExtension" Is there a better way of doing this instead of mapping everything into a new instance? |
anything new? |
I believe the behaviour you're seeing is due to the backingStore. You can therefore probably use this instead to ensure the entire payload is serialized. var extension = await graphClient.Me.ContactFolders["MyContactFolderId"].Contacts["MyContactId"].Extensions["MyExtension"].GetAsync();
extension.AdditionalData["MyProperty"] = "MyNewValue";
// reset the backing store to force the client to send the full object
extension.BackingStore.InitializationCompleted = false;
await graphClient.Me.ContactFolders["MyContactFolderId"].Contacts["MyContactId"].Extensions["MyExtension"].PatchAsync(extension); |
hi, i just tried the extension.BackingStore.InitializationCompleted = false; and it worked. This is much better than creating a new instance and assigning the values. Thank you very much so far. |
Describe the bug
Hello,
I am trying to load an Extension for a Contact, Change a Value then save it, but i am getting the Error in the title.
I found this (#1723) issue before, but there, a contact is loaded and then the Extension is changed.
In my case, i am loading the Extension and nothing else.
Expected behavior
not getting an error i guess?
How to reproduce
var extension = (await _graphClient.Me.ContactFolders["MyContactFolderId"].Contacts["MyContactId"].Extensions["MyExtension"].GetAsync()) as OpenTypeExtension;
extension.AdditionalData["MyProperty"] = "MyNewValue";
await _graphClient.Me.ContactFolders["MyContactFolderId"].Contacts["MyContactId"].Extensions["MyExtension"].PatchAsync(extension);
SDK Version
5.54.0
Latest version known to work for scenario above?
Unknown
Known Workarounds
None
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: