i have the following code:
return "[Inserted new " + typeof(T).ToString() + "]";
but
typeof(T).ToString()
return the full name including namespace
is there anyway to get just the class name (without any namespace qualifiers?)
i have the following code:
return "[Inserted new " + typeof(T).ToString() + "]";
but
typeof(T).ToString()
return the full name including namespace
is there anyway to get just the class name (without any namespace qualifiers?)
typeof(T).Name // class name, no namespace
typeof(T).FullName // namespace and class name
typeof(T).Namespace // namespace, no class name
make use of (Type Properties)
Name Gets the name of the current member. (Inherited from MemberInfo.)
Example : typeof(T).Name;