C#C
C#10mo ago
Vortac

IDisposable Constructor Injection

If I new up a class to inject via constructor injection which has an IDisposable object, does the class receiving the IDisposable parameter need to implement IDisposable?

eg:
 using var soundEngine = new MiniAudioEngine(44100, Capability.Playback);
var player = new SoundEngine(soundEngine);

Does player need to be using var player?
Was this page helpful?