我收到此错误:
无法确定类型 CustomerDetail 和 Customer 之间关联的主体端。
这是我的Customer
和CustomerDetail
模型
[Table("CUSTOMER")]
public class Customer
{
[Required]
[Column("CUSTOMER_ID")]
public int Id {get; set;}
[Column("FIRST_NAME")]
public string FirstName {get; set;}
// other fields
public virtual CustomerDetail customerDetail {get; set;}
}
[Table("CUSTOMER_DETAIL")]
public class CustomerDetail
{
[Required]
[Column("CUSTOMER_DETAIL_ID")]
public int Id {get; set;}
// other fields
public virtual Customer Customer {get; set;}
}
Customer
toCustomerDetail
具有 1:1 的关系。