Everything is correct. This is the name of the type, which is not the same as the declared name you would use in your generated code.
(By the way, to start with, do you know the difference between run-time and compile-time types? If you instantiated
t
, your could call
t.GetType().FullName
, but that would never be a the type
IEnumerable<DataRow>
because the interface is an abstract class, so a run-time type could be only some class (or structure!) implementing
IEnumerable<DataRow>
. That was just a side note.)
Now, do you really need to reproduce a text of declaration of
IEnumerable<DataRow>
? You should do something very different.
You need to use Reflection. You get a meta-model of your type using either
typeof
(compile-time type) or
GetType()
(run-time type which does not exist for interfaces). This operator or call will both return you an object of the type
System.Type
. This is where Reflection starts.
Please see:
http://msdn.microsoft.com/en-us/library/system.type.aspx[
^].
Using
System.Type
methods and properties, you can find out if your type contains generic parameters using
ContainsGenericParameters
. You can get generic arguments using
GetGenericArguments
and their names. In brief, learn all the members of
System.Type
containing "Generic" and other relevant members and learn how to generate code using then. By the way, it may be hard to understand from the first glance, but quite easy to research and develop the code, especially using the debugger.
Good luck,
—SA