public static bool IsNullable(this Type referenceType) { return referenceType.IsGenericType && referenceType.GetGenericTypeDefinition() == typeof(Nullable<>); } }