Back to Writing
NOTEScsharpconstructordesign-pattern

C# Constructor Chaining Explained

September 3, 2019Updated Feb 17, 2026

Post image

Post image

When you have multiple constructors in a class, overloading is the typical solution.

But this approach leads to duplicated initialization code across multiple constructors.

That's where Constructor Chaining comes in.

Post image

The key idea is to consolidate all actual initialization logic into the constructor with the most parameters.

For example, if a Student constructor requires (id, name, lastName) as its base form, then the (id, name) constructor simply passes an empty string ("") for the last value and calls the primary constructor.

The syntax that handles this chaining is the colon (:):

public ClassName(variable, variable) : this(variable, variable, "") { }

After the colon, you can call not only this but also a base class constructor via base(...), as long as the signatures match:

public ClassName(variable, variable) : base(variable, variable, "") { }

Of course, base can only be used when there is an actual inheritance relationship.

References:


Constructor Chaining in C#