Answer: Data Contracts, is used to define Required or NonRequired data members. It can be done with a property named IsRequired on DataMember attribute.
[DataContract]
public class test
{
[DataMember(IsRequired=true)]
public string NameIsMust;
[DataMember(IsRequired=false)]
public string Phone;
}
Regards,
Majith.B
Source: msdn | Asked In: Many Interviews |
Alert Moderator