Is it possible to set the filter constraints to ‘OR’ in linq-to-xml? I iterate through an array in order to filter desired values like this:
XElement root = XElement.Load(fileName);
IEnumerable<XElement> selectedElements = root.Elements("OrderNum").Elements("Job");
for (int i = 1; i < chkBx.Count(); i++)
{
if (chkBx[i].Checked == true)
{
string element = "Diameter";
string match = chkBx[i].Text;
selectedElements = selectedElements.Where(el => (string)el.Parent.Element(element) == match);
}
}
Now the filter will kinda be linked together with an ‘AND’ statement. What if i want to select an element that statisfy any of these filter conditions?
1 Answer