两条linq合并嵌套就出错
//这样分成两步可以
var rootid = (from c in ctx.mf_ProductClass where c.ClassID == int.Parse(classid) select c.ParentPath).First().Split(',')[1];
var attlist = from p in ctx.View_mf_ProductAttList where p.ClassID == Convert.ToInt16(rootid) select p;
//这样合成一步就出错:无法识别的表达式节点: ArrayIndex
var attlist = from p in ctx.View_mf_ProductAttList where (from c in ctx.mf_ProductClass where c.ClassID == int.Parse(classid) select c.ParentPath).First().Split(',')[1].Contains(p.ClassID.ToString()) select p;
//这样也不行,还是同样的错误
var attlist = from p in ctx.View_mf_ProductAttList where p.ClassID == Convert.ToInt16((from c in ctx.mf_ProductClass where c.ClassID == int.Parse(classid) select c.ParentPath).First().Split(',')[1]) select p;
...全文


LINQ

