Say we have the following :
private static string Query<T>(Expression<Func<T, bool>> pr)
{
return pr.ToString();
}
...
int ii = 1000;
string str = Query((SalesInvoiceRow r) => r.Serial > ii && r.CustomerName.Contains( "23"));
When you run the above we get:
r => ((r.Serial > value(testing.program+<>c__DisplayClass0).ii) AndAlso r.CustomerName.Contains("23"))
How can we get the value of
ii
instead of the ugly statement like below?
r => ((r.Serial > 1000) AndAlso r.CustomerName.Contains("23"))