You can try this way just an example:
var rel_man_lin= db.Products.GroupJoin(db.Lines,
p => p.Relation.IdLine,
l => l.IdLine,
(p, result) => new Result(p.IdMaufacture, result));
// Test the Enumerate results to see if it meets your expectation
foreach (var result in rel_man_lin)
{
Console.WriteLine("{0} contains...", result.IdMaufacture);
foreach (var item in result.ListOfState)
{
Console.WriteLine("{0} {1}",item.IdofState, item.NameOfstate);
}
}
Please note that .ListOfState, .NameOfstate and IdofState
don't exist but just to express the idea behind the query as you want result to be formatted as an Id
and a collection
.
I hope it will help you.