Some question of C#
First Question : typeof(classX) -> typeX ... Y(typeX) -> classX
Here is my problem : I know how to get the type of a class or an instance. For this, using typeof(MyClass) or MyInstance.GetType() works great.
But, know, I am facing a problem : I want to call a templated function with the type of instance ... MyFunction<ClassOfMyInstance>(MyInstance)
Is there a keyword that do the opposite of typeof ?
---------------------
Second question :
I have a generic List (List<Something>). How to get the type Something with the instance of my List ?
----------------------
Thanks
First Question : typeof(classX) -> typeX ... Y(typeX) -> classX
Here is my problem : I know how to get the type of a class or an instance. For this, using typeof(MyClass) or MyInstance.GetType() works great.
But, know, I am facing a problem : I want to call a templated function with the type of instance ... MyFunction<ClassOfMyInstance>(MyInstance)
Is there a keyword that do the opposite of typeof ?
---------------------
Second question :
I have a generic List (List<Something>). How to get the type Something with the instance of my List ?
----------------------
Thanks