I have following Enum in my project
public enum CameraAccessMethod
{
Manual = 0,
Panasonic = 1,
Axis = 2,
AirCam = 3
}
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 CameraAccessMethod
. 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.