What advantage does Fluent Validation have over default .NET .NET annotations?

What advantage does the FluentValidation library have over the .NET System.ComponentModel.DataAnnotations?

Does it offer a more flexible check, since it is not annotated (checking a static field) on a property, for example, checking a property against a different property value?

+4
source share
1 answer

I'm not sure about data annotations, but we used FluentValidation for part of validation in business logic. And simple integration with ASP.NET MVC is a good bonus :)

It supports many built-in rules, the localization of error messages, the use of object data in error messages, selective verification methods, conditional verification - apply some rules if the object data matches the condition, rule sets - use a named set of rules, validation of aggregated objects and collections - and property names will be compatible with ASP.NET MVC property names, etc.

+3
source

Source: https://habr.com/ru/post/1435650/


All Articles