A
acgritt
I am looking for some information on if it is possible/how to create a
dynamic XLinq statement. I know for Linq to SQL you can do the
following:
var query = db.Customers.
Where("City = @0 and Orders.Count >= @1", "London", 10).
OrderBy("CompanyName").
Select("new(CompanyName as Name, Phone)");
I am wondering how to do this with Linq to XML. I know I can do the
following:
var elements = doc.Descendants("nodeName").
Where(e => e.Attribute("attrib") == null ||
e.Attribute("attrib").Value != "value");
But I would like to do it more like the Linq to SQL if possible.
Does anyone have any information on this?
Adam
dynamic XLinq statement. I know for Linq to SQL you can do the
following:
var query = db.Customers.
Where("City = @0 and Orders.Count >= @1", "London", 10).
OrderBy("CompanyName").
Select("new(CompanyName as Name, Phone)");
I am wondering how to do this with Linq to XML. I know I can do the
following:
var elements = doc.Descendants("nodeName").
Where(e => e.Attribute("attrib") == null ||
e.Attribute("attrib").Value != "value");
But I would like to do it more like the Linq to SQL if possible.
Does anyone have any information on this?
Adam