I\'m trying to write a validation to check that an Object instance can be cast to a variable Type. I have a Type instance for the type of object they need to provide. But th
I think you need to restate your conditions, because if obj is an instance of Derived, it will also be an instance of Base. And typ.IsIstanceOfType(obj) will return true.
class Base { }
class Derived : Base { }
object obj = new Derived();
Type typ = typeof(Base);
type.IsInstanceOfType(obj); // = true
type.IsAssignableFrom(obj.GetType()); // = true