What is major difference from Fluent Validation?

Aug 4, 2010 at 9:09 AM
Link to the project on CodePlex: http://fluentvalidation.codeplex.com/
Aug 4, 2010 at 11:52 PM

I actually discovered Fluent Validation after the initial release of this project and honestly Fluent Validation is more mature that Validity.NET at this time.

The primary difference is implementation and compile time validation or rules. Validity.NET is built off of generic type "contexts" and extension methods. As such, a statement such as:

validator.RuleFor(x => x.Id).NotNull(); //Id == typeof(Int32)

is perfectly valid in Fluent Validation (although it can never be violated). As an Int32 type does not satisfy the generic type constraint, where T : class in Validity.NET, the validation option for NotNull will not even be displayed in the intellisense options. Therefore, only valid "validators" are presented to the developer based on the type to be validated. String validations only show up when defining rules for a String type, comparison validations only show up when defining rules for an IComparable etc. Also, as Validity.NET uses the idea of "contexts" while building a rule, you can only chain together statements in a logical fashion. (No chained WhenUsingComparer statements etc). I am not sure about Fluent Validation, but to add a custom rule in Validity.NET is as easy as adding a new extension method as shown on the main page, so it will be highly extensible.

Overall, the goal of Validity.NET is to provide options to the developer based on the context of the rule being defined as well as be easily extensible.