Is it possible to use DataAnnotations on an object and then .. programmatically, test to see if that object is Valid or not?
I’m not using MVC3 or ModelBinding or ASP.NET .. but a WinForms app.
Is this possible?
eg.
if (foo.IsValid) ? Hi() : Bye();
and the IsValid somehow checks each property that has DataAnnotations on em, or something. ??
You’re looking for the
Validatorclass.