Given this highly simplified example:
abstract class Animal { }
class Dog : Animal
{
public void Bark() { }
}
class Cat : Animal
{
public void Mew() { }
There is no explicit type conversion exist between Animal to Dog since your constrains says T must be of type Animal. Though Dog ‘Is a’ an Animal , the compiler doesn't know that T is Dog.
Therefore, it doesn't let you cast.
You can either approach this through implicit conversion
implicit operator Animal(Dog myClass)
or can use something like below
Dog d = _animal as Dog;