I looking for a way to get the name of a class (or struct) which is instantiate under C# 6. Exemple :
public class Test
{
public int myvalue;
public Test(int _myvalue){ myvalue= _myvalue;}
}
void Init()
{
public Test test= new Test(1);
}
void main()
{
string nameNewTest = // here what I need, that must return "test", not "Test"
}
I saw lot of topics for find the type like : GetType().Name/nameOf/typeof(Class).Name or some stuff like that but no one for the name of a new variable.