I have a linq statement that I want to add an additional where clause to if a drop down index is not 0.
people.Where(n.surname == \"surname\" || n.forename =
Fortunately, this is easy because queries compose:
var query = people.Where(n.surname == "surname" || n.forename == "forename"); if (dropdown.SelectedIndex > 0) { query = query.Where(n => n.id.ToString() == dropdown.SelectedValue); }