Calling Overridden Constructor and Base Constructor in C#

I would re-chain constructors, so they are called like

Bar() : this(0) 
Bar(int) : Foo(int) initializes Bar
Foo(int) initializes Foo
Foo() : this(0) 

This is suitable, if parameterless constructors are assuming some kind of default value for int parameter of other constructor. If constructors are unrelated, you probably doing something wrong with your type, or maybe we need more information about what are you trying to achieve.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)