Commit 46e23d70 authored by thienvo's avatar thienvo

fixed

parent 8df59de9
......@@ -477,6 +477,7 @@ namespace Sieve.Services
}
outerExpression = Expression.And(outerExpression, innerExpression);
}
var data = outerExpression == null
? result
: result.Where(Expression.Lambda<Func<TEntity, bool>>(outerExpression, parameterExpression));
......@@ -524,15 +525,16 @@ namespace Sieve.Services
case FilterOperator.LessThanOrEqualTo:
return Expression.LessThanOrEqual(propertyValue, filterValue);
case FilterOperator.Contains:
return Expression.Call(propertyValue,
//fixed bug has null in data
return Expression.AndAlso(Expression.NotEqual(propertyValue, Expression.Constant(null, typeof(object))), Expression.Call(propertyValue,
typeof(string).GetMethods()
.First(m => m.Name == "Contains" && m.GetParameters().Length == 1),
filterValue);
filterValue));
case FilterOperator.StartsWith:
return Expression.Call(propertyValue,
return Expression.AndAlso(Expression.NotEqual(propertyValue, Expression.Constant(null, typeof(object))), Expression.Call(propertyValue,
typeof(string).GetMethods()
.First(m => m.Name == "StartsWith" && m.GetParameters().Length == 1),
filterValue);
filterValue));
default:
return Expression.Equal(propertyValue, filterValue);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment