I have a WCF service that has a [DataContract] class defined in it. Each of the properties has the [DataMember] attribute and I have added a couple of Data Annotation attributes [Required] and [StringLength] to a couple of the properties.
I then consume this service in an asp.net MVC application as a service reference. When I get a list of all the attributes using
var attr= from prop in TypeDescriptor.GetProperties(instance).Cast<PropertyDescriptor>()
from attribute in prop.Attributes.OfType<ValidationAttribute>()
select attribute;
I see none of the data annotations have come through. Is this a limitation of WCF or am I doing something fundamentally wrong here?