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)

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

Leave a Reply