I've been using LINQ to SQL and Entity Framework for a few years and I've always mapped my database relationships to generate the relevant navigation properties. And I always use the navigation properties.
Am I missing something?
If I have a Category->Products
one-many type relationship, I would use
var redProducts = context.Category.Single(c => c.Name = "red").Products;
I regularly see people doing manual joins, all over this site, in projects online, and various other websites.
var employer = from category in context.Categories
join product in context.Products
on category.CategoryId equals product.CategoryId
where category.Name == "red"
select product;
So - why? What are the benefits of using this Join
syntax?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…