I have a simple enum:
enum simple
{
one,
two,
three
};
I also have a class that has a property of type simple
. I tried decorating it with the attribute: [XmlAttribute(DataType = "int")]
. However, it fails when I try to serialize it using an XmlWriter
.
What is the proper way to do this? Do I have to mark the enum itself as well as the property, and if so, with which data type?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…