Snippet
public class SomeClass<TItem>
{
public void PrintTypeName()
{
Console.WriteLine(nameof(TItem));
}
}
...
var myClass = new SomeClass<int>();
myClass.PrintTypeName();
Console.WriteLine(nameof(SomeClass<int>));
Console Output
TItem
SomeClass