DamianEdwards / MiniValidation

A minimalist validation library for .NET built atop the existing features in `System.ComponentModel.DataAnnotations` namespace
MIT License
321 stars 25 forks source link

Filter out props for validation #66

Open Kraviecc opened 1 month ago

Kraviecc commented 1 month ago

Context

We have:

For such a scenario, when we try to validate an instance of the class we get an exception (or data lazy loading) even though the engine shouldn't validate the problematic property - it doesn't have any validation attribute nor recurse is enabled.

Solution

Filter out properties without any validation attribute only when the recurse is disabled.

Kraviecc commented 1 month ago

hey @DamianEdwards, do you have time to review the changes?