I have something like this
var emp = db.Employees.toList();
in the table of my employees I have the name emp, emp id and salary, using linq with lambda expressions, how can I access emp id in another variable. I tried to find it, could not find a solution that does this with linq with lambda expressions
var employeeLeaves = db.Leaves
.Include("Employee")
.Include("Employee.Manager")
.Where(l => l.Status.Id == 1)
.GroupBy(l => l.Employee.Manager.Id)
.Select(l => l.GroupBy(k=>k.Employee.Id).Select(j=>j.GroupBy(โโp=>p.GroupId)))
.ToList();
this is the actual query that I have, donโt ask me how I wrote it ..: P now I want to get the id column from employeeLeaves and save it in another variable
source
share