What is the best way to check a base object if of certain type, myObject can have hierarchies at \"n\" level, I want to compare with string because myObject is dynamic and i do
Wrote a little recursive method to solve it:
private bool IsVehicle(Type type) { if (type.BaseType != null) if (type.BaseType.FullName == "Vehicle") return true; else return IsVehicle(type.BaseType); return false; }