I am new to Linq and I just started to study Linq query. I believe this is something to do with projection. But I am clueless how to dig into it to get what I desired in my result. This is my Scenario : Office which has two branches
branch_1, branch_2
branch_1 has dept_1_1 and dept_1_2
branch_2 has dept_2_1 and dept_2_2
each deprtment has employees.
But I need to query through Office to find name of all the employees in dept_2_2 and dept_2_2 is in branch_2
This is something I did.
var result = office.Branch.First()
But first()
will give me branch_1 which I do not want how do I get branch_2 and then further dept_2_2 and then all the employees .
I would be thankful to help me out to write linq queries.