I have a class that is marked with [Serializable]. When i return it from the Web API the field names are all funky.
Normally the JSON returned is
[{"OrderId":797 ...
JSON returned when using [Serializable]
[{"<OrderId>k__BackingField":797 ...
I wan't to mark it serializable to use a BinaryFormatter for caching. Is there any other way than to write a custom serializer or to make a twin class that is not serializable and write monkey code to "cast" between the two?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…