Reflecting on type parameters
suggest changeThe typeof
operator works on type parameters.
class NameGetter<T>
{
public string GetTypeName()
{
return typeof(T).Name;
}
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents