WCF

WCF Examples

WCF

WCF Projects

WCF Project

Data Contract Enumerations
Previous Home Next

Enumerations are always serializable by definition. When you explain a new enum, there is no need to apply the DataContract attribute on it, and you can freely use it in a data contract

Using an enum in a data contract

enum ContactType
{
   EName,
   EmpPost,
   EmpAddress
}
[DataContract]
struct Contact
{
   [DataMember]
   public ContactType ContactType;
   [DataMember]
   public string FName;
   [DataMember]
   public string LName;
}

 

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: