Skip to content
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

Closed
pranavkm opened this issue Dec 8, 2014 · 4 comments

Comments

@pranavkm
Copy link
Contributor

pranavkm commented Dec 8, 2014

In the implementation of IValidatableObject.Validate \ custom ValidateAttribute, all you get is an instance of ValidationContext. Short of using CallContextServiceLocator, there is no way to get to services that could be used as part of validation.

ValidationContext does support a way to pass in an IServiceProvider and consume it as part of validation. We should modify DataAnnotationsModelValidatorProvider to pass in HttpContext.RequestServices as the IServiceProvider when setting up the ModelValidationContext instance.

@yishaigalatzer
Copy link
Contributor

This issue is not clear enough. Please edit and add details.

@pranavkm
Copy link
Contributor Author

Updated.

@danroth27 danroth27 added this to the Backlog milestone Jan 10, 2015
@tuespetre
Copy link
Contributor

:ping:

This one could be closed

@rynowak
Copy link
Member

rynowak commented May 18, 2016

@tuespetre thanks!

This was fixed by 328f4d6

@rynowak rynowak closed this as completed May 18, 2016
@rynowak rynowak modified the milestones: 1.0.0-rc2, Backlog May 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants