Update Core

This commit is contained in:
sunkaixuan
2022-05-13 20:44:40 +08:00
parent e9a469baad
commit b27e322bb2
3 changed files with 19 additions and 6 deletions

View File

@@ -443,7 +443,7 @@ namespace SqlSugar
{ {
ConditionalType = ConditionalType.Equal, ConditionalType = ConditionalType.Equal,
FieldName = this.QueryBuilder.Builder.GetTranslationColumnName(column.DbColumnName), FieldName = this.QueryBuilder.Builder.GetTranslationColumnName(column.DbColumnName),
FieldValue = value.ObjToString(), FieldValue = value.ObjToStringNew(),
CSharpTypeName = column.PropertyInfo.PropertyType.Name CSharpTypeName = column.PropertyInfo.PropertyType.Name
}); });
if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL) if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)

View File

@@ -71,6 +71,15 @@ namespace SqlSugar
if (thisValue != null) return thisValue.ToString().Trim(); if (thisValue != null) return thisValue.ToString().Trim();
return ""; return "";
} }
public static string ObjToStringNew(this object thisValue)
{
if (thisValue != null && thisValue is byte[])
{
return string.Join("|",thisValue as byte[]);
}
if (thisValue != null) return thisValue.ToString().Trim();
return "";
}
public static string ObjToString(this object thisValue, string errorValue) public static string ObjToString(this object thisValue, string errorValue)
{ {

View File

@@ -593,6 +593,10 @@ namespace SqlSugar
{ {
return Convert.ToUInt16(item.FieldValue); return Convert.ToUInt16(item.FieldValue);
} }
else if (item.CSharpTypeName.EqualCase("byte[]")&&item.FieldValue!=null&&item.FieldValue.Contains("|"))
{
return item.FieldValue.Split('|').Select(it=>Convert.ToByte(it)).ToArray();
}
else else
{ {
return item.FieldValue; return item.FieldValue;