Open hackedd opened 11 years ago
Any reason why you want to use structs?
The core reason we never supported structs
was coz SimpleJson was focused primarily on passing json around http and most c# devs would just go with classes. If you are using SimpleJson for other features let us know and we can look into it. In the mean time feel free to send a PR.
In this case I'd want to use a struct
because a point represents a single value (similar to a primitive type), and it makes sense to use a value type. However, changing the code to use a class
instead is of course trivial.
I'll see if I can work out how to instantiate structs
.
SimpleJson is unable to deserialize a struct because it can not contain an explicit parameterless constructor. For example:
Will throw a
NullReferenceException
when trying to invoke the constructor inPocoJsonSerializerStragegy.DeserializeObject