Is there a way to specify that a [Flags] enumeration field in a class should be serialized as the string representation (e.g. "Sunday,Tuesday") rather than the integer value (e.g. 5)?
To be more specific, when returning the following SomeClass type in a web service, I want to get a string field named "Days" but I'm getting a numeric field.
[Flags]
public enum DaysOfWeek
{
Sunday = 0x1,
Monday = 0x2,
Tuesday = 0x4,
Wednesday = 0x8,
Thursday = 0x10,
Friday = 0x20,
Saturday = 0x40
}
[DataContract]
public class SomeClass
{
[DataMember]
public DaysOfWeek Days;
}