A
Andrus
I need to create method which returns my application object type as string :
TypeName(typeof( List<int>)) should return "List<int>" or
"System.Collections.Generic.List<int>"
TypeName(typeof( MyType<Customer>)) should return
"MyNamesp.MyType<MyBusiness.Customer>"
etc.
I tried
static string TypeName(Type type) {
return type.Name;
}
but this returns wrong names (´1 etc) for generic types.
How to get correct type name for generic types ?
Andrus.
TypeName(typeof( List<int>)) should return "List<int>" or
"System.Collections.Generic.List<int>"
TypeName(typeof( MyType<Customer>)) should return
"MyNamesp.MyType<MyBusiness.Customer>"
etc.
I tried
static string TypeName(Type type) {
return type.Name;
}
but this returns wrong names (´1 etc) for generic types.
How to get correct type name for generic types ?
Andrus.