-
Notifications
You must be signed in to change notification settings - Fork 10.4k
OwningComponentBase implements IAsyncDisposable #62583
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
Merged
ilonatommy
merged 6 commits into
dotnet:main
from
rolandVi:OwningComponentBase-implements-IAsyncDisposable
Jul 8, 2025
Merged
OwningComponentBase implements IAsyncDisposable #62583
ilonatommy
merged 6 commits into
dotnet:main
from
rolandVi:OwningComponentBase-implements-IAsyncDisposable
Jul 8, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ilonatommy
reviewed
Jul 7, 2025
@dotnet-policy-service agree |
Reverted one change
javiercn
reviewed
Jul 7, 2025
javiercn
reviewed
Jul 7, 2025
Removed `OwningComponentBase.DisposeAsync()` from the PublicAPI as the implementation is private now
javiercn
reviewed
Jul 7, 2025
javiercn
reviewed
Jul 7, 2025
javiercn
approved these changes
Jul 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
javiercn
reviewed
Jul 7, 2025
/ba-g failure connected with known issue |
sins921
approved these changes
Jul 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-blazor
Includes: Blazor, Razor Components
breaking-change
This issue / pr will introduce a breaking change, when resolved / merged.
needs-breaking-change-announcement
Indicates that breaking change announcement shuold be posted and linked to this PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OwningComponentBase implements IAsyncDisposable
Description
This pull request enhances the
OwningComponentBase
class by adding support for asynchronous disposal, improving resource management, and updating tests to validate the new functionality. The most important changes include implementing theIAsyncDisposable
interface, adding new methods for asynchronous disposal, updating the public API, and introducing new test cases to ensure proper behavior.Enhancements to
OwningComponentBase
:src/Components/Components/src/OwningComponentBase.cs
: Updated theOwningComponentBase
class to implement theIAsyncDisposable
interface. AddedDisposeAsync
,DisposeAsyncCore
, and updated theDispose
method to handle both synchronous and asynchronous disposal of the service scope.Public API updates:
src/Components/Components/src/PublicAPI.Unshipped.txt
: AddedDisposeAsync
andDisposeAsyncCore
methods to the public API to reflect the new asynchronous disposal capabilities.Testing improvements:
src/Components/Components/test/OwningComponentBaseTest.cs
: Added new test cases to verify the behavior ofDisposeAsync
, ensure that accessing scoped services after disposal throws an exception.Fixes #25873