views:

131

answers:

3

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?)

+15  A: 
typeof(T).Name // class name, no namespace
typeof(T).FullName // namespace and class name
typeof(T).Namespace // namespace, no class name
Tim Robinson
+2  A: 

make use of (Type Properties)

 Name   Gets the name of the current member. (Inherited from MemberInfo.)
 Example : typeof(T).Name;
Pranay Rana
+1  A: 

typeof(T).Name;

Datoon