Validating a class using DataAnotations

Posted by runxc1 Bret Ferrier on Stack Overflow See other posts from Stack Overflow or by runxc1 Bret Ferrier
Published on 2009-12-04T15:31:48Z Indexed on 2010/03/08 10:06 UTC
Read the original article Hit count: 497

Filed under:
|
|

I have a class that I am using to model my data in MVC. I have added some DataAnotations to mark fields that are required and I am using regular expressions to check valid Email Addresses. Everything works fine if the object is posted back to MVC and I have the ModelState property that I can check to confirm that the class is valid but how do I check to see if the class is valid outside of MVC using the same class and Data Anotations that I have already set up?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#