New to Linq, trying to query an XDocument. I want elements where a certain attribute is equal to one of two values.
Looking for suggestions on how to streamline this query:
query = from xElem in doc.Descendants(StringLiterals._streamNodeName)
where ((0 == xElem.Attribute(StringLiterals._typeAttributeName).Value.CompareTo(StringLiterals._sWorkspace)) ||
(0 == xElem.Attribute(StringLiterals._typeAttributeName).Value.CompareTo(StringLiterals._sNormal)))
select new AccuRevXmlElement
{
_location = xElem.Attribute(StringLiterals._nameAttributeName).Value,
_streamNumber = xElem.Attribute(StringLiterals._streamNumberAttributeName).Value
};
Thanks for any ideas.