Assume i have the following tables in DB
Departments
ID Name
1 Engineering
2 Accounting
3 Sales
Employees
ID Name DeparmentId
1 Phill 1
2 moore 1
3 lucas 2
4 john 2
5 sophie 3
6 george 3
what i want to do is to group by Employees
by Deparments
. I know the standard method of grouping will group employees by either departmentID
or Department Name
. But i want is the grouping key must be an object having multiple properties (ID and Name). Is there away to do this? please provide me some code!