I'm trying to use Entlib 4's validation blocks but I'm running into a problem clearly identifying invalid properties in the validation results.
In the following example, if the City property fails validation I have no way of knowing whether it was the City property of the HomeAddress object or the WorkAddress object.
Is there a simple way to do this without creating custom validators, etc?
Any insight into what I'm missing or not understanding would be greatly appreciated.
Thank you.
public class Profile
{
...
[ObjectValidator(Tag = "HomeAddress")]
public Address HomeAddress { get; set; }
[ObjectValidator(Tag = "WorkAddress")]
public Address WorkAddress { get; set; }
}
...
public class Address
{
...
[StringLengthValidator(1, 10)]
public string City { get; set; }
}