我有几种情况,其中我的导航属性在一个类中重复,或者我不希望它与它所代表的类具有相同的名称。例子:
public class Employee
{
public Guid EmployeeId { get; set; }
public string Name { get; set; }
}
public class Project
{
public Guid ProjectId { get; set; }
public DateTime Start { get; set; }
public Guid ResponsibleId { get; set; }
public virtual Employee Responsible { get; set; }
public Guid OwnerId { get; set; }
public virtual Employee Owner { get; set; }
}
使用 EF Code First 时,它会弄乱外键,创建具有不同名称的新键。我该如何处理?
非常感谢!