this is two hour now that i am trying to make some reflection on an extention method. what i want is call the generic static method called "Field" of DataRow and i didn't sucess. Can anyone help me ?
Here's my code :
ParameterExpression pe = Expression.Parameter(typeof(DataRow), "field");
var x = typeof(DataRowExtensions).GetMethod(
"Field",
new Type[]{typeof(DataRow),typeof(string)});
var gx = x.MakeGenericMethod(typeof(DataRow));
var y = new[] { Expression.Constant(TwoParts[0]) };
Expression left = Expression.Call(pe, gx, y);
Expression right = Expression.Constant(val.Remove(0, 1));
var w = e1 = Expression.NotEqual(left, right);