I have a class that first needs to call the derived class constructor before it calls the base constructor. I know that by the following code the base constructor will be called first
public class A {
protected A () {
//do something
}
}
public class B : A {
public B () : base() {
//do something else
}
}
Is their a way to reverse that order, or a work around for it. The solution with creating an additional protected method in the base-class like doConstructor() and call it in the derived constructor after the first task isn't possible with readonly fields because the compiler will not accept it.