Constructor Chaining in C#


C# Constructor chaining is something pretty simple to accomplish in most classes. It is pretty common to have multiple constructors, but chaining them makes it a little easier to manage.

Here is a simple way to accomplish constructor chaining:

Now when you call the constructor with the string parameter, it will automatically call the base constructor passing in a new Account object that is created from the id.

This is pretty straight forward and easy to use. It makes your code easier to maintain as well.