When calling a static method on parent class, can the parent class deduce the type on the child (C#)
- by Matt
Suppose we have 2 classes, Child, and the class from which it inherits, Parent.
class Parent
{
public static void MyFunction(){}
}
class Child : Parent
{
}
Is it possible to determine in the parent class how the method was called? Because we can call it two ways:
Parent.MyFunction();
Child.MyFunction();
My current approach was trying to…