© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
48 replies
CrosRoad95

❔ Service provider, IDisposable

if i do:
Services.AddScoped/Transient<MyDisposableClass>();
class MyDisposableClass : IDisposable { ... }
Services.AddScoped/Transient<MyDisposableClass>();
class MyDisposableClass : IDisposable { ... }

will dispose method called when service goes out of scope?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Service Provider Question
C#CC# / help
6mo ago
IDisposable Constructor Injection
C#CC# / help
12mo ago
IDisposable ownership semantics
C#CC# / help
15mo ago
✅ Implementing IDisposable properly
C#CC# / help
3y ago