You will not be able to use Auto Properties, since you need to exactly match the type of base class. You have to go the old fashioned way:
public abstract class Child : Base
{
private ChildProperty1 _bp1;
public BaseProperty1 bp1
{
get { return _bp1; }
set { _pb1 = value as ChildProperty1; }
}
}
You can also use generics to solve the problem:
public abstract class Parent<TProp> where TProp : BaseProperty1
{
public abstract T bp1 { get; set; }
}
public abstract class Child : Parent<ChildProperty1>
{
public ChildProperty1 bp1 { get; set; }
}
source
share