I'm trying to do something like this but I'm getting an error along the lines of:
Cannot convert from AbstractExampleClass to SpecificExampleClassA.
So I'm probably going in the wrong direction with this code, can anyone tell me what's wrong and how to fix it.
public abstract class AbstractExampleClass
{
// Code goes here
}
public class SpecificExampleClassA : AbstractExampleClass
{
}
public class SpecificExampleClass : AbstractExampleClass
{
}
public class handler
{
public void Handle(AbstractExampleClass aec)
{
HandleSpecific(aec);
}
public void HandleSpecific(SpecificExampleClassA a)
{
// DoSomething
}
public void HandleSpecific(SpecificExampleClassB b)
{
// DoSomething Else
}
}