Created
May 25, 2010 03:32
-
-
Save apiguy/412721 to your computer and use it in GitHub Desktop.
This file contains 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
public static Func<T, bool> ExBuildEqFuncFor<T>(string prop, object val) | |
{ | |
var o = Expression.Parameter(typeof(T), "t"); | |
Expression<Func<T, bool>> expression = | |
Expression.Lambda<Func<T, bool>>( | |
Expression.Equal( | |
Expression.PropertyOrField(o, prop), | |
Expression.Constant(val)), o); | |
return expression.Compile(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment