Data block or application verification block

What is the difference between DataAnnotations and Block Validation Block?

+6
validation block data-annotations
source share
1 answer

DataAnnotations is an attribute-based model for annotating your data, and it resides in the .NET platform itself. Its most obvious use is for validation, such as ASP.NET MVC. The Application Validation block itself is a validation framework created by the Microsoft P & P team, but it is not part of the .NET platform. It also contains attributes to “annotate” your data and, in its latest version (5.0), attributes inherited from DataAnnotations, which to some extent makes them interchangeable with DataAnnotations.

The Application Validation block or the entire corporate library is more focused on enterprise development. VAB allows for many more complex scenarios. For example, it allows you to put validation rules in configuration files or (with a bit of work) in code. It also allows you to use the "rulesets" function, which allows you to group checks and run only one rule group for an object. There is not much you can not do that validation is for VAB, but it certainly comes at a price. Price is complexity. Despite the fact that VAB is not so easy to learn, it’s not easy for you to learn, as I’m still learning new ways to do something about it.

Compared to DataAnnotations, DataAnnotations is very simple, but also very limited when it comes to more complex scenarios.

+9
source share

All Articles