MiniValidation icon indicating copy to clipboard operation
MiniValidation copied to clipboard

Make polymorphism support an option

Open DamianEdwards opened this issue 3 years ago • 0 comments

Supporting polymorphism requires the entire object graph of the object being validated be walked every time as any member of a type maybe a descendent type at runtime for that instance (modulo sealed types). This is obviously expensive so consider adding an option to make polymorphism an option (static property or new options object passed in to TryValidate). When disabled only the declared type of members would be considered when determining if a member has anything warranting validation (which is cached).

DamianEdwards avatar Mar 17 '22 16:03 DamianEdwards