Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在学习实体框架和 linq-to-entities。
可以使用 JOINS(join 关键字)或使用导航字段(关联)从多个表中获取交叉值,在这种情况下,框架知道如何引用交叉数据。
我的问题是什么时候使用?
我的 0.02 美元:尽可能使用导航。不要join在 LINQ to Entities 或 LINQ to SQL 中使用,除非您被迫这样做。我在这里通过示例更详细地解释了这一点:
join
join在 LINQ to SQL 和 LINQ to Entity 中被认为是混乱的、冗余的