这2个查询有什么区别?他们是完全平等的?linq中的Where和Join有什么区别?
from order in myDB.OrdersSet
from person in myDB.PersonSet
from product in myDB.ProductSet
where order.Persons_Id==person.Id && order.Products_Id==product.Id
select new { order.Id, person.Name, person.SurName, product.Model,UrunAdı=product.Name };
和
from order in myDB.OrdersSet
join person in myDB.PersonSet on order.Persons_Id equals person.Id
join product in myDB.ProductSet on order.Products_Id equals product.Id
select new { order.Id, person.Name, person.SurName, product.Model,UrunAdı=product.Name };
你为什么把问题标为“实体框架”?也许你在实体框架中使用linq,但这不是一个普通的linq问题。 – erasmus 2010-06-10 09:20:12
是的,我以为你说了什么。我不是专家,我从来没有用过正常的LINQ查询时,我开始学习实体框架,我看到它,并认为连接方法可以依赖于EF.Now我知道它不是EF问题,所以我现在删除该标签。 – Freshblood 2010-06-10 09:37:49