实体框架核心指向同一实体的多个外键

时间:2019-10-31 15:34:09

标签: c# entity-framework-core-2.2

例如,我有这两个实体

public class Group
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Email { get; set; }
    public ICollection<EmployeeGroup> EmployeesGroups { get; set; }
}

public class ProcessState
{
    public int Id { get; set; }        
    public string PendingEntity { get; set; }
    public string ApprovingEntity { get; set; }
    public string Message { get; set; }
    public ICollection<Process> Processes { get; set; }
}

我想要

PendingEntity
ApprovingEntity 

成为组实体的外键。

int PendingEntity - Group.Id
int ApprovingEntity - Group.Id

如何在我的模型上描述它?

0 个答案:

没有答案