Skip to content
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

Deserializing Dictionary<string, object> #22

Open
lm-adruschel opened this issue Jun 9, 2020 · 1 comment
Open

Deserializing Dictionary<string, object> #22

lm-adruschel opened this issue Jun 9, 2020 · 1 comment

Comments

@lm-adruschel
Copy link

In dynamic runtime very often you need to store values in Dictionary<string, object> variables. These can be serialized without problems, but not deserialized. The original Type is not persistant and the result will be a Dictionary with KVP like: ("key1", {object}), ("key2", {object}) etc.

Is there any recommended workaround or solution to this problem?

@Arlodotexe
Copy link

Arlodotexe commented Mar 4, 2022

I'd recommend serializing the type information yourself alongside the actual data, and using Type.GetType() to get the target type back for deserialization. Unfortunately until #30 is resolved, you'll have to use reflection to pass this type into the Deserialize method.

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

No branches or pull requests

2 participants