如何在EFCore中使用自定义属性进行映射?

时间:2020-09-24 08:11:46

标签: entity-framework entity-framework-core

public class Employee {
    [Key]
    public int Id { get; set; }

    public string Name { get; set; }

    public string Surname { get; set; }

    public string RegistrationNumber { get; set; }

    public string ManagerRegistrationNumber { get; set; }

    public Employee Manager { get; set; }
}

一名雇员可能有一名直接经理。直接经理也可能有许多直接报告,但我现在不需要。 员工和经理之间的映射应通过“ RegistrationNumber”和“ ManagerRegistrationNumber”属性进行。

0 个答案:

没有答案
相关问题