日期:2014-05-20 浏览次数:20725 次
using (var context = new LswEntities()) { var query = from q in context.Common_Address join city in context.Common_City on new { CityID = q.CityID, ProvinceID = q.ProvinceID } equals new { CityID = city.CityID, ProvinceID = city.ProvinceID } into cityGroup select q; }
using(var context = new LswEntities()) { var query = from q in context.Common_Address join city in context.Common_City on q.CityID equals city.CityID && q.ProvinceID equals city.ProvinceID select new { CityID = q.CityID, ProvinceID = q.ProvinceID }; }
------解决方案--------------------
你原来写的linq里把 into xxx 去掉。
var query = from q in context.Common_Address
join c in context.Common_City on
new { q.CityID, q.ProvinceID } equals
new { c.CityID, c.ProvinceID } into cityGroup
select q;