A way to look at it from left to right, as usual, when creating a task in the language.
So, in C #, the equivalent of calling assigningTo.IsAssignableFrom(assigningFrom) (or any of the other methods you mention) should think of it as "will the following code work":
<assigningTo type> variable = <instance of assigningFrom>;
When applying this to your code, you want to use:
interfaceType.IsAssignableFrom(implementingObject.GetType()) interfaceType.IsAssignableFrom(implementingObject.GetType().BaseType)
The logic is that you want to know if any of the types of the implementation object can assign an interface type or, in other words, if the implementation object can be assigned to an interface.
source share