Enum Serialization Json vs XML

SWAT

New Member
I have following Enum in my project \[code\]public enum CameraAccessMethod { Manual = 0, Panasonic = 1, Axis = 2, AirCam = 3 }\[/code\]I have an object that is serialized either to json or to XML depending upon different scenarios and one of object's property is of type \[code\]CameraAccessMethod\[/code\]. The problem i have is that when this property is serialized to XML it will give string representation of enum values (Manual, Panasonic,Axis,Aircam) but in JSON it is serialized to number values (0,1,2,3). How can i avoid this inconsistency? i want strings in JSON serialization as well.
 
Back
Top