I have several classes which inherit from a BaseClass which has an abstract method called GetData. In one of them I want to basically inherit from again and provide use a new method called GetArticles which I call from GetData. Here's the code.
public abstract class BaseClass
{
internal abstract void GetData();
}
internal class FirstClass : BaseClass
{
internal override void GetData()
{
// calls GetArticles
}
protected void GetArticles()
{
}
}
internal class SecondClass : FirstClass
{
protected new void GetArticles()
{
}
}
GetArticles
is never called in SecondClass
. It calls the one in FirstClass
, even though my object is of type SecondClass
. I can't make GetArticles
in FirstClass
Abstract
because I want to use FirstClass
in its own right.
Any suggestions?
new
does not override a method.