I have several classes (one of which is called `Pet`) that extend the class `Animal`. If I have a generic method, can I use `typeof` to compare with the base class? 

```
if (typeof(T) == typeof(Animal))
{
    return ((Animal)pet).Color;
}

```

What's currently happening in my code is that this clause is getting skipped entirely. This isn't desired in this particular example, since `Pet` inherits from `Animal`.