Browse Source

Synchronization code

pull/31/head
sunkaixuan 2 years ago
parent
commit
ad799406ec
  1. 2
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/MappingFieldsHelper.cs
  2. 4
      Src/Asp.NetCore2/SqlSugar/Utilities/UtilMethods.cs

2
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/MappingFieldsHelper.cs

@ -44,7 +44,7 @@ namespace SqlSugar
FieldName = item.LeftEntityColumn.DbColumnName,
ConditionalType = ConditionalType.Equal,
FieldValue = item.RightEntityColumn.PropertyInfo.GetValue(model).ObjToString(),
CSharpTypeName = item.RightEntityColumn.PropertyInfo.PropertyType.Name
CSharpTypeName =UtilMethods.GetUnderType(item.RightEntityColumn.PropertyInfo.PropertyType).Name
}));
i++;
}

4
Src/Asp.NetCore2/SqlSugar/Utilities/UtilMethods.cs

@ -782,6 +782,10 @@ namespace SqlSugar
CSharpTypeName = ctypename,
FieldValue = value
};
if (item.FieldValue == string.Empty && item.CSharpTypeName.HasValue() && !item.CSharpTypeName.EqualCase("string"))
{
return null;
}
if (item.CSharpTypeName.EqualCase(UtilConstants.DecType.Name))
{
return Convert.ToDecimal(item.FieldValue);

Loading…
Cancel
Save