http://stackoverflow.com/questions/6931783/why-gettype-returns-system-int32-instead-of-nullableint32
public static Type GetActualType(Type type, out bool isNullable)
{
Type ult = Nullable.GetUnderlyingType(type);
if (ult != null)
{
isNullable = true;
return ult;
}
isNullable = false;
return type;
}