Open jhughes2112 opened 3 years ago
You know I have never used a HashSet
!!
I believe you can swap it with a List
for data transfer objects, and it seems only good for set operations...
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 RegisterCustomType()
.
If HashSet
implemented IList
all would be good, so I will have to find another way...
Seems like anything derived from IEnumerable
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!