C#C
C#13mo ago
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?

c#
public class IpLookupService : IIpLookupService
{
    private readonly Reader _reader;  // This property can be disposed
}
Was this page helpful?