This must have a simple answer -- I have a piece of code that looks like this ...
condition = Expression.Call(memberAccess,
typeof(string).GetMethod("Contains"),
Expression.Constant(value));
lambda = Expression.Lambda(condition, parameter);
it works great ... BUT I also want a NotContains. Am I going to have to write an extension method or is there a way to simply do a ![lambda] ?
Surround with Expression.Not:
condition = Expression.Not(Expression.Call(memberAccess,
typeof(string).GetMethod("Contains"),
Expression.Constant(value)));
lambda = Expression.Lambda(condition, parameter);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With