In .Net the Interface System.IServiceProvider is a simple and elegant method to query services from other objects without having – or even wanting – to know how the class structure behind it looks like. Is the interface at that class implemented or at another? No matter, you query IServiceProvider and you get an instance of what you asked for.
That’s the theory. In reality the developer may have forgotten to add the new interface to the list after he implemented it. Or he forgot the IServiceProvider altogether.
That’s why I have this method to get what I want through several fallback strategies: