mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-09 09:55:05 +08:00
Update UtilMethods
This commit is contained in:
@@ -601,11 +601,15 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
var method = destinationType.GetMyMethod("Parse", 1);
|
var method = destinationType.GetMyMethod("Parse", 1);
|
||||||
if (method != null)
|
if (method != null)
|
||||||
{
|
{
|
||||||
var result = method.Invoke(null, new object[] { value });
|
var result = method.Invoke(null, new object[] { value });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (value is byte[] && destinationType == typeof(char))
|
||||||
|
{
|
||||||
|
return (char)((byte[])value)[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()))
|
||||||
return destinationConverter.ConvertFrom(null, culture, value);
|
return destinationConverter.ConvertFrom(null, culture, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user