I did some Google search but could not find anything. So I implemented something working with an intermediate constructor.
However, I am wondering whether it is possible to chain more than one constructor at the same time (base + this).
This is my current (simplified) code:
public BlaNode(Node Previous, Node Next) : base(Previous, Previous)
{
this.Blas = new HashSet<BlaDiBla>();
}
public BlaNode()
: this(null, null)
{
}
public BlaNode(Node Previous, Node Next, string Bla)
: this(Previous, Previous)
{
}
No, you can only call one constructor at a time in a C# constructor initializer. The documentation refers to only one other constructor to call, too:
You can make your intermediate constructor
privateif you do not want any other code to call it.