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

Support for TypeDescriptor #52

Closed warappa closed 8 months ago

warappa commented 8 months ago

Issue

In TypeDetailsCache, among other things the attributes of properties are collected and cached.

I want to switch from System.Components.DataValidation.Validator to this library as it is ~3x as fast for huge data validation and also straight forward.

One thing that is missing for my usecase is TypeDescriptor support like in SCD.Validator. This is missing from here as TypeDetailsCache does not take it into account.

I don't want to propose an always invalidating cache. For my use-case (and hopefully many others) it would already help if it would detect any extra annotations configured via TypeDescriptor at the time it lazily scans the type and its properties.

As an alternative, an extension point to feed more validation property attributes to TypeDetailsCache would be helpful.

Info

.NET 7 MiniValidation: 0.8.0