1

我有以下内容:

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>();

当我去数据库地址不是属性的一部分。有人有想法么?

4

0 回答 0