Map Entities to self-joined Table by Id
问题 My legacy table "AllData" has those columns: Id, Title, LookupColumn1Id My entities: public class BaseEntity { public virtual int Id { get; set; } public virtual string Name { get; set; } } public class Employee: BaseEntity { public virtual int DepartmentId { get; set; } public virtual string DepartmentName { get; set; } } public class Department: BaseEntity { public virtual int HeadManagerId { get; set; } } I want to generate SELECT like this: SELECT EmployeeTable.Title, DepartmentTable.Id,