我有以下内容:
public interface IPerson
{
string Name {get; set;}
... more attributes ...
IAddress Address {get; set;}
}
public interface IAddress
{
string Street {get; set;}
... more ...
}
public class Person: IPerson
{
public string Name {get; set;}
... more attributes ...
IAddress Address {get; set;}
}
public class Address: IAddress
{
public string Street {get; set;}
... more ...
}
在我的上下文类中我定义了以下内容:
public DbSet<Property> Properties { get; set; }
在我所拥有的相同上下文文件的OnModelCreating
中
modelBuilder.Configurations.Add(new PropertyMap());
modelBuilder.ComplexType<Address>();
当我去数据库时,地址不属于Property。有人有什么想法吗?