I there a way to get proper serialization of structs in DTO’s or better yet have the framework somehow treat the structs as dto’s.
I have been informed of the JsConfig.TreatValueAsRefTypes value but that would just work for json am I right? what about xml, soap, mq ect…
I simply want to use the structs I have an not have to map them to dto’s which for my project would take years…
On the side not I also cant figure out what im doing wrong with JsConfig.TreatValueAsRefTypes the compiler seems to think its being called in static context:
An object reference is required for the non-static field, method…
I’ve just committed a change (available in the next release) that makes
JsConfig<T>.TreatValueAsRefTypeas static so you can now serialize struct types as a reference type, e.g:ServiceStack uses .NET’s XML DataContractSerializer (which is also used in SOAP) which already serializes structs as expected with:
You can also use the static API to register struct types using the non-generic API: