Is it possible to indicate that the [Flags] enumeration field in the class should be serialized as a string representation (for example, "Sunday, Tuesday"), and not an integer value (for example, 5)?
To be more specific, returning the following SomeClass type in the web service, I want to get a string field called "Days", but I get 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;
}
Yuval source
share