Join:
var data = db.Product
.Join(db.ArtikelGroep,
a => a.ProductId,
b => b.HoofdGroepId,
(a, b) => new { a, b })
.Where(p => p.a.ProductId < 25).OrderBy(p => p.a.Name);
var records = data.ToList();
GroupBy:
var results = persons.GroupBy( p => new { p.Id, p.Name },
p => p.car,
(key, g) => new {
PersonId = key,
Cars = g.ToList()
}
);
53200cookie-checkC# Linq Examples