public class Employee {
[Key]
public int Id { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string RegistrationNumber { get; set; }
public string ManagerRegistrationNumber { get; set; }
public Employee Manager { get; set; }
}
一名雇员可能有一名直接经理。直接经理也可能有许多直接报告,但我现在不需要。 员工和经理之间的映射应通过“ RegistrationNumber”和“ ManagerRegistrationNumber”属性进行。