I've got an extension method:
public static class StringEx
{
public static bool Like(this string a, string b)
{
return a.ToLower().Contains(b.ToLower());
}
}
How to reflect it properly via GetMethod with my parameters? I've tried this with no success (Got an exception about static method):
var like = typeof(StringEx).GetMethod("Like", new[] {typeof(string), typeof(string)});
comparer = Expression.Call(prop, like, value);
You should use another overload of GetMethod with BindingAttr parameter: