Dynamic Linq to Xml example
问题 I need a basic example on how to use System.Linq.Dynamic with Xml. Here’s a functioning statement I want to convert to dynamic Linq: XElement e = XElement.Load(new XmlNodeReader(XmlDoc)); var results = from r in e.Elements("TABLES").Descendants("AGREEMENT") where (string)r.Element("AGRMNT_TYPE_CODE") == "ISDA" select r.Element("DATE_SIGNED"); foreach (var x in results) { result = x.Value; break; } Here’s the approach I am using: string whereClause = "(\"AGRMNT_TYPE_CODE\") == \"ISDA\"";