I have a linq statement that I want to add an extra where clause if the drop down index is not 0.
people.Where(n.surname == "surname" || n.forename == "forename" && (dropdown.SelectedIndex > 0) ? n.id = dropdown.SelectedValue : n.id > 0).Select(n => n);
I'm not even sure if what I'm trying to do is possible?
I would like to do this, and not write two different statements.
Any ideas?
thanks
source
share