Skip to content

GetValidatedArgument[Async] uses context.RequestServices#760

Merged
SimonCropp merged 2 commits intoSimonCropp:mainfrom
mbcrawfo:use-scoped-service-provider
May 3, 2023
Merged

GetValidatedArgument[Async] uses context.RequestServices#760
SimonCropp merged 2 commits intoSimonCropp:mainfrom
mbcrawfo:use-scoped-service-provider

Conversation

@mbcrawfo
Copy link
Contributor

@mbcrawfo mbcrawfo commented Feb 17, 2023

Using the schema to access the root service provider made it impossible to use validators with a scoped lifetime, or with scoped dependencies. By using context.RequestServices we can access the service provider that's appropriate for the current scope (Asp.Net request scope, or a child scope created for a field resolver).

Using the schema to access the root service provider made it impossible to use validators with a scoped lifetime, or with scoped dependencies.  By using context.RequestServices we can access the service provider that's appropriate for the current scope (Asp.Net request scope, or a child scope created for a field resolver).
@mbcrawfo mbcrawfo force-pushed the use-scoped-service-provider branch from e98a30b to cdf8fc8 Compare February 17, 2023 20:58
@mbcrawfo mbcrawfo changed the title GetArgument[Async] uses context.RequestServices GetValidatedArgument[Async] uses context.RequestServices Feb 17, 2023
@mbcrawfo
Copy link
Contributor Author

@SimonCropp any feedback on these changes?

@SimonCropp SimonCropp added this to the 8.3.0 milestone May 3, 2023
@SimonCropp SimonCropp merged commit e583376 into SimonCropp:main May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants