Closed cubed-it closed 5 years ago
Here is the result. I had to make one change to make it work properly since it only supported non abstract class. So i allowed interface. Maybe i should allow abstract types too. The problem is deserialization of interface/abstract type. I am working on fixing it to properly use the $type embedded
If you pull the latest code in the branch that i just pushed. You can get the same result in my screenshot. Also not that you have to use NetJSON.IncludeTypeInformation = true instead of using the settings. Because I have not been able to make it work with the settings object so far since it is mostly runtime compilation changes that needs to be done. I am trying to generate less code
I was able to make it work now with interface and abstract type.
I take that back. It does not work with abstract type properly. There is a current bug that i have. I will try to work more on it once i get IncludeTypeInformation as part of the property of netjson setting object
Please test and let me know if it works for you. Thanks
If it works for you then i can create a nuget package for it.
Hey, sorry for the delay, I was very busy with other problems ;) Looks good so far! Interfaces support is suficent for my purpose - but all you said may of cause be interesting for the future or someone else I guess. Great work!
While IncludeTypeInformation serialize all information for an single object of an interface it does not provide all properties for a enumerable list of an interface.
iscs = {"SimpleClassProp":null,"SimpleClassBaseProp":null} iscsE = [{"SimpleClassBaseProp":null}]
It would be nice if all fields were also available for lists.