Checking for Nullable types is easy, int? is actually System.Nullable
.
So you just check if the type is a generic instance of System.Nullable
.
Setting shouldn't make a difference, nullableProperty.SetValue(instance, null)
or nullableProperty.SetValue(instance, 3)