我的模型的一部分看起来像这样:
public class Person
{
public virtual Guid Id { get; set; }
public string Name { get; set; }
}
public class Employee : Person
{
public virtual int EmployeeNumber { get; set; }
public virtual Person Partner { get; set; }
}
为此生成的sql是:
create table [Person] (
Id UNIQUEIDENTIFIER not null,
Name NVARCHAR(255) null,
Employee_id UNIQUEIDENTIFIER null,
primary key (Id)
)
create table Employee (
Person_id UNIQUEIDENTIFIER not null,
EmployeeNumber INT null,
Partner_Id UNIQUEIDENTIFIER null,
primary key (Person_id)
)
为什么Person表中有Employee_id UNIQUEIDENTIFIER null,
?