I have two things to mention, first is that the base (inherited) ctor always runs first and there is no way around that! The second thing, you can also inherit ctors from current class (this), to do that, in the ctor instead of inheriting base ( : base()) you inherit this ( : this()).
But how do you now make a list of Persons in which you can store multiple sub classes like Employee and Manager? I am unable to make it work and there are no clear examples of it online
Is it just me or the code is multiplying the same code in order to reduce writing the same code… it might be a tad different but it’s still writing the same general code over and over. Not your fault, I think it’s an issue with c#
🚀 C# Progress Academy - Become a job-ready C# and Angular web developer to land your dream developer role: bit.ly/45vbPUg
short and clear. Nice on my boy
Glad you liked it!
I have two things to mention, first is that the base (inherited) ctor always runs first and there is no way around that! The second thing, you can also inherit ctors from current class (this), to do that, in the ctor instead of inheriting base ( : base()) you inherit this ( : this()).
this is the best explanation, thank you
Constructor Inherehtence is kinda similar to Polymorphism as base type name changes to value provided by Employee subclass
But how do you now make a list of Persons in which you can store multiple sub classes like Employee and Manager? I am unable to make it work and there are no clear examples of it online
Is it just me or the code is multiplying the same code in order to reduce writing the same code… it might be a tad different but it’s still writing the same general code over and over. Not your fault, I think it’s an issue with c#
Excessive talk is not the explanation and it is not the explanation
You talk too much = losing the basic meaning