Browse Source

Synchronization code

pull/32/head
sunkaixuan 2 years ago
parent
commit
3a5762692d
  1. 2
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs
  2. 4
      Src/Asp.NetCore2/SqlSugar/Utilities/ExpressionBuilderHelper.cs

2
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

@ -226,7 +226,7 @@ namespace SqlSugar
var member = (item as MemberExpression);
if (member.Member.Name == "HasValue")
{
newItem = ExpressionBuilderHelper.CreateExpression(member.Expression, Expression.Constant(null), ExpressionType.Equal);
newItem = ExpressionBuilderHelper.CreateExpression(member.Expression, Expression.Constant(null), ExpressionType.NotEqual);
}
AppendItem(parameter, name, new List<Expression>() { newItem}, model, newItem);
}

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

@ -44,6 +44,10 @@ namespace SqlSugar
{
return Expression.Equal(left, Expression.Convert(value, left.Type));
}
else if (type == ExpressionType.NotEqual)
{
return Expression.NotEqual(left, Expression.Convert(value, left.Type));
}
else
{
//Not implemented, later used in writing

Loading…
Cancel
Save