var query=from c in ServerClass let id=ServerClass.FirstOrDefault(f=>f.ClassName=="保洁").ID where c.Fid==id select c.ClassName;
可以了 谢谢
var query = (from m in ServerClass
where m.ClassName.IndexOf("保洁")>-1
select m.Fid).FirstOfDefault();
完整的数据图 他包括
@yellowshorts:
var query = (from m in ServerClass
where m.ClassName.IndexOf("保洁")>-1
select m).ToList();
然后 foreach 遍历就可以了。
var q = from item in serverclass
where item.Fid==
(
from tmp_item in serverclass
where tmp_item.ClassName='保洁'
select tmp_item.ID
)
select item.classname
谢谢