views:

181

answers:

2

I'm moving some code from Microsoft.Practices.EnterpriseLibrary.Validation.Validators to System.ComponentModel.DataAnnotations, and have come across a more complex validator that I am having trouble in changing it to DataAnnotations, anyone got any pointers on how I can convert this?

[NotNullValidator]
[DomainValidator("M", "F", "A", MessageTemplate = "{0} is not valid for {1}")]
public string Gender { get; set; }
A: 

In answer to my own question, you don't have to, and perhaps it's best not to, check out my other question on Passing Validation Exceptions via WCF and Rest

Coppermill