我使用EF Code First,并希望将实体类Person映射到实体表personTable,如下所示,
我有一个实体类
public class Person
{
public Guid Id
{
get;
set;
}
public string Email
{
get;
set;
}
public int Property
{
get;
set;
}
public Name Name
{
get;
set;
}
}
和一个属性名称类型的类
public class Name
{
public string FirstName
{
get;
set;
}
public string FullName
{
get
{
return string.Format("{0} {1} {2}", FirstName, MiddleName, LastName);
}
}
public string LastName
{
get;
set;
}
public string MiddleName
{
get;
set;
}
}
我想将人员类映射到人员表如下
Person.Id => personTable.ID
Person.Name.FirstName ->personTable.FirstName
Person.Name.MiddleName => personTable.MiddleName
Person.Name.LastName => personTable.LastName
and so on....
Person.Name
类型的对象在哪里Name Class