I have the following abstract base class in which i have an abstract method. I need to know how to implement this abstract method in the child classes. The problem is how do I declare a class whose base is SomeBaseClass in Class B.
public abstract class A
{
protected abstract void Add<T>(T number) where T : SomeBaseClass;
}
public class B : A
{
protected override void Add<T>(T number)
{
throw new NotImplementedException();
}
}
I think you want the base class to have a type parameter, not a specific method: