I want to return the next class through a web service that includes an enumeration type as one of its members.
[Serializable, XmlRoot("GeoCoordinate")] public class GeoCoordinate { public enum AccuracyLevel { Unknown = 0, Country = 1, Region = 2, SubRegion = 3, Town = 4, PostalCode = 5, Street = 6, Intersection = 7, Address = 8, Premise = 9 } private AccuracyLevel _accuracy;
This works correctly, but returns the result as:
<Accuracy>Unknown or Country or Region or SubRegion or Town or PostalCode or Street or Intersection or Address or Premise</Accuracy>
Instead of a string representing an enumeration, I would just like to return an integer. Can this be done without changing the type of GeoCoordinate.Accuracy ?
Karmic coder
source share