【发布时间】:2016-04-18 06:58:22
【问题描述】:
我有一个这样的 xml 字段的类:
Public System.Xml.Linq.XElement ProductAttributeXML {get;set;}
我有一个如下查询:
var query = (from product in db.ProductAttributeCombinations
where product.ProductAttributeXML.DescendantNodes().Count()>0
select product
);
var x = query.ToList();
但是当运行项目和ToList() 我得到这个错误:
方法 'System.Collections.Generic.IEnumerable`1[System.Xml.Linq.XNode] DescendantNodes()' 不支持 SQL 转换。
我该怎么做?
【问题讨论】:
标签: c# xml linq linq-to-xml