我首先在我的应用程序中使用以下模型和 Entity Framework 6 代码。
public class Customer
{
public Customer
{
}
public int Id { get; set; }
public string Name { get; set; }
public virtual Address Address { get; set; }
}
public class Address
{
public Address
{
}
public int Id { get; set; }
public string Street { get; set; }
public int Number { get; set; }
public int Country { get; set; }
public virtual Customer Customer { get; set; }
}
当我尝试保存它们时,出现以下错误:
Unable to determine the principal end of an association between the types Customer and Address