CSharp · Console
using System;
public class Program
{
enum Some
{
One,
Two
}
class Foo
{
public Some? Bar
{
get;
set;
}
}
public static void Main()
{
var t = typeof(Foo);
var prop = t.GetProperty("Bar");
var propt = prop.PropertyType;
if (propt.IsGenericType && propt.GetGenericTypeDefinition() == typeof(Nullable<>))
{
var q = propt.GetGenericArguments()[0];
q.IsEnum.Dump();
}
Console.WriteLine("Hello World");
}
}