How to append condition to existing expression
I have Linq Expression and I want to append or || condition to expression if true.ex.
Expression myexpression;
myexpression = x => x.search(x.empId) || x.search(x.empName);
If(×.vendorId != null)
{ myexpression = x => x.search(x.empId) || x.search(x.empName) || x.search(x.vendorId); }
Above I reapeated same expression and append extra || or condition. I have so many conditions to check.
Is there any other simpler way to do it.So that I can get output like below.
myexpression =myexpression + || x.search(x.vendorId)
Thanks,
Ashish Mayekar