© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•14mo ago•
7 replies
Core

✅ Disposable class level property

Hello

If there is a singleton service that uses a disposable class level property, should the service implement IDisposable as well?
Also, wouldn't the property be disposed automatically upon application shutdown, only if it implements IDisposable?

public class IpLookupService : IIpLookupService
{
    private readonly Reader _reader;  // This property can be disposed
}
public class IpLookupService : IIpLookupService
{
    private readonly Reader _reader;  // This property can be disposed
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,828Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ is it a good disposable class?
C#CC# / help
3y ago
ValueType disposable scope
C#CC# / help
5mo ago
❔ Maybe Disposable Object
C#CC# / help
3y ago
❔ can a static class contain static class as property
C#CC# / help
3y ago