If I write:
var type = typeof(List);
Console.WriteLine(type.Name);
It will write:
List`1
No, it makes perfect sense for it to include the generic arity in the name - because it's part of what makes the name unique (along with assembly and namespace, of course).
Put it this way: System.Nullable and System.Nullable
public static string GetNameWithoutGenericArity(this Type t)
{
string name = t.Name;
int index = name.IndexOf('`');
return index == -1 ? name : name.Substring(0, index);
}
Then:
var type = typeof(List);
Console.WriteLine(type.GetNameWithoutGenericArity());