Problem modelling relationship in Entity Framework using code first
问题 I'm trying to learn code first within the Entity Framework and am having trouble modelling a relationship. It's a basic HR database which for the sake of this has two entities, Employees and Departments. The Employee belongs to a department and the department has a Team Administrator and a Manager, both of whom are in effect employees. I've tried to model this using the following: EMPLOYEE public int? DepartmentID { get; set; } public virtual Department Department { get; set; } Context: