1
Vote

[SimpleIoc] Add a way to invoke Dispose() on all created instances that dispose IDisposable

description

I have interfaces that may be implemented by classes that also implement IDisposable. Since I don't know which services actually implement it, I have to go manually over all registered instances, try to cast them and invoke the method. Since SimpleIoc doesn't expose the list of all created/registered instances, it would be very convenient if at least it exposed a method that invokes Dispose() on all created instances that need it. That way I can call that method in my Cleanup() routine.

comments