How to get the type of a generic parameter in C# and VB.NET

To get the type of a generic parameter in C# and VB.NET you can use the following snippet.

Sample C#

Type typeParam = typeof(T);

Sample VB.NET

Dim typeParam As Type = GetType(T)

Please Share us:
Please rate this snippet

3 thoughts on “How to get the type of a generic parameter in C# and VB.NET

Leave a Reply