Open adambajguz opened 1 year ago
Hi @adambajguz , thank you for contribution.
Since it's a breaking change, I need to spend more time considering all aspects of it. Could you be more specific and provide an example where such generic-less IValidator
interface would benefit the most? A situation where IValidator<T>
is a pain and there is explicit need for just IValidator
?
Hi @bartoszlenar,
IValidator
is useful when writing an integration with ASP.NET Core because model validation in ASP.NET Core doesn't use generics (more on that in #29). Also there is a HolderInfo
class in Validot with CreateValidator()
method that returns an object
It would be useful to have a
IValidator
interface withobject
basedIsValid
andValidate
methods. Also the new interface can expose aSpecifiedType
property to easily access the type the validator is validating. This new interface will allow a non-generic code (e.g. in ASP.NET Core) to easily validate models.