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