-
Notifications
You must be signed in to change notification settings - Fork 147
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 deserialize HashSet<> #129
Comments
You know I have never used a I believe you can swap it with a |
HashSet is basically just the keys part of the Dictionary type. Very fast lookups and strongly typed, but also has set operations. It's good! In my case List works fine. Out of curiosity, is there a way to extend fastJSON with new types easily? |
You can use If |
Seems like anything derived from IEnumerable could be handled generically, which would take care of most or all of the Collections.Generic types. |
I have a class that contains a HashSet in it. The output looks perfect and contains the string entries as expected. Deserializing that file back into a class fails with an invalid cast, approximately here in JSON.cs (776):
No specific type seems to be stored in the $types array. Here's an example, where bseos is a HashSet:
I can convert this to a List for serialization purposes in my case, but it would be worth supporting the correct generic collection.
Thanks!
The text was updated successfully, but these errors were encountered: