I'm trying to get information about which child called parents constructor. I'm not allowed to pass the argument onto the constructor. Is something like this possible?
class Parent {
Parent() {
Console.WriteLine("Child1 called me");
}
}
class Child1: Parent {
string name;
Child1(string name) {
this.name = name;
}
}
class Child2: Parent {
string surname;
Child1(string surname) {
this.surname = surname;
}
}