I have a an abstract base class FooBase
that's inherited by Foo
. And I have another abstract base class BarBase
that's inherited by Bar
. BarBase
contains an abstract FooBase
property. And in Bar
I want to set the FooBase
property to Foo
. Why is this not allowed? Is this a crazy design that needs to be rethought, or can it be done in some way?
public abstract class FooBase
{
}
public class Foo : FooBase
{
}
public abstract class BarBase
{
public abstract FooBase Foo { get; set; }
}
public class Bar : BarBase
{
public override Foo Foo { get; set; }
}