I have an abstract class as follow:
class BaseReturnType { }
class DerivedReturnType : BaseReturnType { }
abstract class BaseClass<T> where T : BaseReturnType
{
public abstract T PolymorphicMethod();
}
class DerivedClass : BaseClass<DerivedReturnType>
{
public override DerivedReturnType PolymorphicMethod()
{
return new DerivedReturnType();
}
}
So if add exta parrameter for Generic called T2 how do I put extrac constraining on this?
abstract class BaseClass<T, **T2**> where T : BaseReturnType ???
{
public abstract T PolymorphicMethod();
}