| | |
| | | |
| | | private MemberExpression common_left; |
| | | |
| | | private UnaryExpression common_right; |
| | | //private UnaryExpression common_right; |
| | | private ConstantExpression common_right; |
| | | |
| | | public WhereHelper() |
| | | |
| | |
| | | |
| | | var propertyValue = converter.ConvertFromInvariantString(value.ToString()); // 3 |
| | | var constant = Expression.Constant(propertyValue); |
| | | common_right = Expression.Convert(constant, propertyType); // 4 |
| | | common_right = constant; // 4 |
| | | |
| | | // common_right = Expression.Constant(value, value.GetType());//æå»ºä¸ä¸ªå¸¸é,弿¯ value |
| | | } |
| | |
| | | |
| | | Expression result = Expression.Equal(common_left, common_right); |
| | | |
| | | filter = Expression.And(filter, result); |
| | | filter = Expression.AndAlso(filter, result); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | Expression result = Expression.NotEqual(common_left, common_right); |
| | | |
| | | filter = Expression.And(filter, result); |
| | | filter = Expression.AndAlso(filter, result); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | Expression result = Expression.GreaterThan(common_left, common_right); |
| | | |
| | | filter = Expression.And(filter, result); |
| | | filter = Expression.AndAlso(filter, result); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | Expression result = Expression.GreaterThanOrEqual(common_left, common_right); |
| | | |
| | | filter = Expression.And(filter, result); |
| | | filter = Expression.AndAlso(filter, result); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | Expression result = Expression.LessThan(common_left, common_right); |
| | | |
| | | filter = Expression.And(filter, result); |
| | | filter = Expression.AndAlso(filter, result); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | Expression result = Expression.LessThanOrEqual(common_left, common_right); |
| | | |
| | | filter = Expression.And(filter, result); |
| | | filter = Expression.AndAlso(filter, result); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | Expression result = Expression.Call(left, typeof(string).GetMethod("Contains", new Type[] { typeof(string) }), right); |
| | | |
| | | filter = Expression.And(filter, result); |
| | | filter = Expression.AndAlso(filter, result); |
| | | |
| | | } |
| | | |