title: C#: Test if a class in an instance of a super class instead of a subclass
body: <p>I have a class, which has a bunch of subclasses that inherit from it. How can I test to see whether an object is an instance of that super class, and not of any of the derived classes?</p>
  
  <p>Example:</p>
  
  <p>I have a Vehicle class, and it has several classes that inherit from it, like Car, Motorcycle, Bicycle, Truck, etc.</p>
  
  <p>Assuming this, how do I test to see if a Vehicle object is really of the class Vehicle, and not Car or Bicycle? (Since a Car and a Bicycle are in this case an instance of the Vehicle class, too.)</p>