In WCF, can a struct be used as a DataContract ?

 Posted by Akiii on 4/10/2012 | Category: WCF Interview questions | Views: 6568 | Points: 40
Answer:

Yes, a struct can be used as a DataContract. For example :-

[DataContract]

struct EmployeeInfo
{
[DataMember]
public int id;

[DataMember]
public string name;

[DataMember]
public DateTime joining_date;
}



Thanks and Regards
Akiii


| Alert Moderator 

Comments or Responses

Login to post response