public static bool IsIntegralType(this Type type)
{
type = type.GetUnwrappedNullableType();
return type == typeof(string)
|| type.IsNumericType()
|| type == typeof(Guid)
|| type == typeof(DateTime)
|| type == typeof(TimeSpan)
|| type == typeof(bool)
|| type == typeof(byte[]);
}