I have 3 following classes:
public class BaseProperty1{
public string Property1 {get; set;}
}
public class ChildProperty1 : BaseProperty1 {
}
public abstract class Base{
public abstract BaseProperty1 bp1 {get; set;}
}
I’m trying to derive a following class from Base:
public class Child : Base{
public ChildProperty1 bp1 {get; set;}
}
But I’m getting an error that “set” and “get” methods are not implemented. Is it just the syntax I’m using or my way of thinking is wrong?
Thank you!
You won’t be able to use Auto Properties since you have to match the type of the base class exactly. You’ll have to go the old fashioned way:
You might also be able to use generics to solve the problem: