Created
May 23, 2011 22:03
-
-
Save palfrey/987722 to your computer and use it in GitHub Desktop.
Build your own Expression's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var lam = Expression.Lambda<Func<string, bool>> | |
| ( | |
| Expression.Call | |
| ( | |
| Expression.Invoke( | |
| Expression.Lambda | |
| ( | |
| Expression.Call | |
| ( | |
| paramExpr, | |
| typeof (String).GetMethod("ToLower", new Type[] {}) | |
| ), | |
| new List<ParameterExpression>{paramExpr} | |
| ), | |
| new List<ParameterExpression>{paramExpr} | |
| ), | |
| typeof(String).GetMethod("Contains", new [] { typeof(string) }), | |
| new Expression[] | |
| { | |
| Expression.Constant(query.ToLower()) | |
| } | |
| ), | |
| new List<ParameterExpression>{paramExpr} | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment