gpt4 book ai didi

c# - 无法确定类型之间关联的主体端

转载 作者:可可西里 更新时间:2023-11-01 07:57:40 25 4
gpt4 key购买 nike

<分区>

我收到这个错误:

Unable to determine the principal end of an association between the types CustomerDetail and Customer.

这是我的CustomerCustomerDetail 模型

[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;}
}

CustomerCustomerDetail 是 1:1 的关系。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com