5 ms·
It's not convenient, but it's clear. I would love something akin to this JEP in C#, but I'd want it in a way that makes it very clear that you're executing cod
by ziml77 4y ago
It's not convenient, but it's clear.
I would love something akin to this JEP in C#, but I'd want it in a way that makes it very clear that you're executing code prior to the base class' fields being initialized.
Something along this lines of this
public Foo(int bar)
{
prector
{
var baz = bar * bar;
base(baz);
}
ctor
{
// Foo's constructor code
}
}