在过去的两天里,这让我疯狂.我有3个非常基本的类(好了,为了便于阅读而减少)
public class Employee
{
public string Name { set; get; }
virtual public Employer Employer { set; get; }
public Employee(string name)
{
this.Name = name;
}
}
Run Code Online (Sandbox Code Playgroud)
,
// this basically ties Employee and his role in a company.
public class EmployeeRole{
public int Id { set; get; }
virtual public Employee Employee { set; get; }
public string Role { set; get; }
public EmployeeRole(Employee employee, string role){
this.Employee = employee;
this.Role = role;
}
}
Run Code Online (Sandbox Code Playgroud)
和 …