This commit is contained in:
sunkaixuan
2025-03-19 15:28:31 +08:00
parent 483f75620f
commit 776c6c26e9

View File

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