Define a method in base class that returns the name of itself (using reflection) - subclasses inheri
- by Khnle
In C#, using reflection, is it possible to define method in the base class that returns its own name (in the form of a string) and have subclasses inherit this behavior in a polymorphic way?
For example:
public class Base
{
public string getClassName()
{
//using reflection, but I don't want to have to type the word "Base" here.
…