Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds support for async service scope in request executor #7826

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PascalSenn
Copy link
Member

@PascalSenn PascalSenn commented Dec 13, 2024

In case you add a service to the DI that only has implemented IAsyncDisposable you will get the following error:

'YourType' type only implements IAsyncDisposable. Use DisposeAsync to dispose the container.

Instead of creating a AsyncServiceScope on every resolver execution, it should be enough to just check if the scope implements IAsyncDisposable:
https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/AsyncServiceScope.cs

@michaelstaib michaelstaib added the 🍒 cherry-pick Consider cherry-picking these changes into the previous major version. label Dec 13, 2024
@michaelstaib michaelstaib self-requested a review December 13, 2024 21:35
@michaelstaib michaelstaib added this to the HC-14.3.0 milestone Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 cherry-pick Consider cherry-picking these changes into the previous major version. 🌶️ hot chocolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants