In the Join below, I'd like to use multiple fields to do the join rather than just one field.
var join = group.Join(procSums, g => g.DeptID, ps => ps.key.deptID, (g, ps)...
All examples Ive found use the query style to do this and I can't translate it.
Thanks!
You just have to Join based on new anonymous objects:
// ClasID is a placeholder, it could be any property you'd like
var join = group.Join(procSums,
g => new { g.DeptID, g.UnitLoc, g.Proc },
ps => new
{
DeptID = ps.key.deptID,
UnitLoc = ps.key.unitLoc,
Proc = ps.key.procName
},
(g, ps) => new { g, ps });
You need to pass lambda expressions that create anonymous types with the fields.
For example:
group.Join(procSums, g => new { g.DeptID, g.OtherField }, ps => new { ps.key.deptID, ps.key.OtherField }, ...)
The anonymous types must match exactly.