Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validation framework in C#?

In the java world there is the bean validation framework JSR-303 which is a nicely well thought out strategy for performing data validation in both the presentation and persistence layers of an application. It covers a lot of things, including validation of whole graph models, validation domain grouping, i18n, etc.

I have failed to find any data model validation frameworks in C#. Are there anything similar to JSR-303 in C#?

like image 594
someName Avatar asked Nov 16 '11 21:11

someName


2 Answers

You can try fluent validation:

http://fluentvalidation.codeplex.com/

like image 119
ADIMO Avatar answered Oct 04 '22 20:10

ADIMO


There is the Enterprise Library Validation block. http://msdn.microsoft.com/en-us/library/ff648831.aspx

It may not do some of the specific items you are asking about (i18n) out of the box, but it fits the bill for many other use cases.

Also, is free to use and has source code available.

like image 30
StingyJack Avatar answered Oct 04 '22 20:10

StingyJack