Update UtilMethods

This commit is contained in:
sunkaixuan
2025-03-19 15:27:16 +08:00
parent 991cd3ccd9
commit 483f75620f

View File

@@ -606,6 +606,10 @@ namespace SqlSugar
return result;
}
}
else if (value is byte[] && destinationType == typeof(char))
{
return (char)((byte[])value)[0];
}
var destinationConverter = TypeDescriptor.GetConverter(destinationType);
if (destinationConverter != null && destinationConverter.CanConvertFrom(value.GetType()))
return destinationConverter.ConvertFrom(null, culture, value);