IAsyncDisposable not working #25817
-
Hi, I have a component which inherits from OwningComponentBase. So if I implement the IDisposable inside one of my scoped services everything is ok. My problem is that I want to save data before disposing the service.
Is IAsyncDisposable not supported yet? Thanks Thomas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We didn't yet add In your @implements IAsyncDisposable Then in your component's public ValueTask DisposeAsync() => Service.DisposeAsync(); I'm filing #25873 to track improving this. |
Beta Was this translation helpful? Give feedback.
We didn't yet add
IAsyncDisposable
support toOwningComponentBase
, but you can implement it manually on your subclass.In your
.razor
component that has@inherits OwningComponentBase<TSomething>
, add:Then in your component's
@code
block, also add:I'm filing #25873 to track improving this.