Example: A is a manager, B is A's subordinate, and C is B's subordinate.
What I need to do is to display a list of subordinates that shows on A's screen which are B and C's info. This is what I have now that will display whoever has A as their manager which are B and etc.
displayList = db.LeaveApplicationDbSet
.Where(l => db.EmployeeDbSet
.FirstOrDefault(e => e.user_id.Equals(l.UserId))
.manager_id.Equals(userDetails.EmployeeId)
);
Any idea on how I can get the grand child portion of the hierarchy?? e.g.: A -> B -> C so from A's view he/she should be able to see B and C's info
Update:
public class MysqlDbContext: DbContext
{
public MysqlDbContext() : base(dbName)
{ }
public DbSet<Employee> EmployeeDbSet { get; set; }
}
public class Employee : IValidatableObject
{
[Column("id")]
public int id { get; set; }
[Required]
[Column("user_id")]
public string user_id { get; set; }
[Column("full_name")]
public string full_name { get; set; }
[Required]
public string manager_id { get; set; }
}