var emuCity = x.Descendants("qu") .Where(p => p.Element("id").Value.Trim().Substring(2, 4) != "0000" && p.Element("id").Value.Trim().Substring(4, 2) == "00") .Join(ormDataContext.A_Area, a => a.Element("id").Value.Trim().Substring(0,2)+"0000", b => b.stateCode, (a, b) => new A_Area { areaName_cn = a.Element("name").Value.Trim(), //名称 areaNamePinYin = PinYinConvert.GetPinYing(a.Element("name").Value.Trim()), //拼音 stateCode = a.Element("id").Value.Trim() });
这是一个join的应用,
a.join(b,a=>a.id,b=>b.id,(a,b)=>new{})
大概的意思就是这样,这是lambada的写法,