LinQ Join加 where提示错误
var p=from a in Test_addresses
join b in Test_person_addresses on a.Id equals b.Address_id into b
where b.Address_id==2
select a
出现错误提示:
“System.Collections.Generic.IEnumerable<LINQPad.User.Test_person_address>”不包含“Address_id”的定义,并且找不到可接受类型为“System.Collections.Generic.IEnumerable<LINQPad.User.Test_person_address>”的第一个参数的扩展方法“Address_id”(是否缺少 using 指令或程序集引用?)
------解决方案--------------------(from a in Test_addresses
join b in Test_person_addresses on a.Id equals b.Address_id into b
where b.Address_id==2
select a).First();
------解决方案--------------------var p=from a in Test_addresses
join b in Test_person_addresses.Where(x=>x.Address_id==2)
on a.Id equals b.Address_id into b
select a;