Does Grace support IAsyncDisposable?
See original GitHub issueDoes Grace automatically dispose not only services implementing IDisposable
but also the newly introduced (.NET Standard 2.1 / .NET Core 3.0) async version named IAsyncDisposable
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
GraceRegistration.cs
Grace Extensions for ASP.Net Core. Contribute to ipjohnson/Grace.DependencyInjection.Extensions development by creating an account on GitHub.
Read more >Implementing both IDisposable and IAsyncDisposable
Proxy might not support IAsyncDisposable . Failing to cast object to IDisposable will present hard to catch bugs in your app.
Read more >Implement a DisposeAsync method
If no synchronous disposable of your class is possible, having only IAsyncDisposable is acceptable. All of the guidance for implementing the ...
Read more >How to properly dispose in AspNetCore application?
The quick answer implies that your AspNetCore aplication is stateless. ... Modern IoC frameworks, such as Grace supports lots of different ...
Read more >How to properly use IAsyncDisposable in C#8
The interface requires an implementation of a method with the signature public ValueTask DisposeAsync(). That's it. However, there are multiple ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool, I’ve already started working on it.
Basically, we will have to make changes in the Grace and then in the Grace.DependencyInjection.Extensions package. I will open PR to Grace throughout next week, so we can discuss.
A few points I want to highlight:
I will check that in detail, but as I can already see, AspNetCore 5.0+ supports IAsyncDisposable service providers:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.serviceprovider?view=dotnet-plat-ext-5.0 https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpresponse.registerfordisposeasync?view=aspnetcore-5.0