.Net Object Verification

Can I use the Application Validation block for a high-performance program? I mean, when I get objects from the stream, and I need to check their values ​​when analyzing the data. As I understand that reflection is involved ...

Are there any alternative tools that I can use to scan objects?

+3
source share
2 answers

This will greatly depend on the definition of the objects you are checking. Objects that contain many properties that need to be checked or even contain collections of objects that need to be checked, validation takes longer. However, in general, 1000 objects per second, of course, will not be a problem for VAB.

The Application Validation block caches the XML configuration file as an in-memory graphic, so you don’t have to worry about loading the file and parsing the XML each time to validate the objects. VAB has some good optimizations.

+1
source

Free Validation and Free Validation 2.0 are excellent validation frameworks that allow you to validate your classes at any time, as well as create client-side validators.

0

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


All Articles