Skip to content

IObjectSerializer docs are outdated #497

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

Closed
shweaver-MSFT opened this issue Mar 30, 2021 · 3 comments · Fixed by #534
Closed

IObjectSerializer docs are outdated #497

shweaver-MSFT opened this issue Mar 30, 2021 · 3 comments · Fixed by #534

Comments

@shweaver-MSFT
Copy link
Contributor

Doc link: https://docs.microsoft.com/en-us/windows/communitytoolkit/helpers/objectserializer

The IObjectSerializer docs are outdated and show an implementation based on the previous signatures, which used strings.

The new signatures use object instead, so the sample code won't actually compile.

I don't have a good example for what it should be, because the solution is not so straight forward with object over string.

@michael-hawker
Copy link
Collaborator

@RosarioPulella mind taking a look into this later?

@Rosuavio
Copy link
Contributor

Rosuavio commented Jun 9, 2021

It seems this API changed in CommunityToolkit/WindowsCommunityToolkit#3702.
I am not sure if it makes more sense to change the API back as String -> T and T -> String seem like better representations of serialization. I know this purpose of this API is to be used with the storage helpers and its this was changed to better work with the storage helpers than perhaps we should rename the class so it can be less misleading.

Either way I made a PR updating the docs.

@michael-hawker
Copy link
Collaborator

Yeah, we updated to object, as the UWP API accepts object for primitives. So we made it broader so it could be agnostic of the end result for the basic SystemSerializer we ship in the Toolkit. Though in most cases you would be going to a string, but you could have some other DB or data store that just accepts other types, so that's why it's more generalized now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants