我有一张表,其中包含我想要分析的页面列表。其中一个字段是URL
,毫不意外包含pagehit的URL。这包括任何查询字符串,例如http://foo.bar/default.aspx?test=1234
将字符串拆分为LINQ to Entities
我想去掉从该表的查询字符串我的分析和思考以下简单的字符串拆分将工作:
var pageHits = from p in context.Pagehits
let URL = p.URL.Split('?')[0]
select p;
但是我得到的错误: The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities.
鉴于该表是相当沉重什么是最好的方式来返回没有查询字符串的网址?
编辑: 我可以,如果我叫.ToList
它的工作,但似乎计算过度