Skip to content

IAsyncDisposable not working #25817

Discussion options

You must be logged in to vote

We didn't yet add IAsyncDisposable support to OwningComponentBase, but you can implement it manually on your subclass.

In your .razor component that has @inherits OwningComponentBase<TSomething>, add:

@implements IAsyncDisposable

Then in your component's @code block, also add:

public ValueTask DisposeAsync() => Service.DisposeAsync();

I'm filing #25873 to track improving this.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SteveSandersonMS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants