This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
Consider flowing IServiceProvider through the ValidationContext
created in DataAnnotationsModelValidatorProvider
#1682
Labels
Milestone
In the implementation of
IValidatableObject.Validate
\ customValidateAttribute
, all you get is an instance ofValidationContext
. Short of usingCallContextServiceLocator
, there is no way to get to services that could be used as part of validation.ValidationContext
does support a way to pass in anIServiceProvider
and consume it as part of validation. We should modifyDataAnnotationsModelValidatorProvider
to pass inHttpContext.RequestServices
as theIServiceProvider
when setting up theModelValidationContext
instance.The text was updated successfully, but these errors were encountered: