Reflection with Generics : Generic Type « Reflection « C# / CSharp Tutorial






using System;
using System.Reflection;
public class Program
{
  static void Main()
  {
      Type type;
      type = typeof(System.Nullable<>);
      Console.WriteLine(type.ContainsGenericParameters);
      Console.WriteLine(type.IsGenericType);

      type = typeof(System.Nullable<DateTime>);
      Console.WriteLine(!type.ContainsGenericParameters);
      Console.WriteLine(type.IsGenericType);
  }
}








19.10.Generic Type
19.10.1.Type: MakeGenericType
19.10.2.Reflection with Generics
19.10.3.Using Reflection with Generic Types