第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

由于模型 InverseProperty,Asp.net core 2.1 崩潰

由于模型 InverseProperty,Asp.net core 2.1 崩潰

C#
白板的微信 2021-07-05 17:47:27
我的網(wǎng)站在加載時(shí)崩潰,System.Reflection 中第一次調(diào)用 DbContext 時(shí)出現(xiàn)了一個(gè)非常長(zhǎng)的未處理異常。最后 2 個(gè)字段是相反的[Table("Report_Group")]public class Group{    [Key, Required, Column("GroupId")]    public int Id { get; set; }    [Required, MaxLength(5)]    public string OrgCode  { get; set; }    [Required, MaxLength(100)]    public string Name { get; set; }    public int TierId { get; set; }    public int? ParentGroupId { get; set; }    public int? CostCenter { get; set; }    [Required]    public int ExcludeFromAlertStats { get; set; }    [Required]    public int GroupTypeId { get; set; }    [ForeignKey("ParentGroupId")]    public virtual Group Parent { get; set; }    [ForeignKey("OrgCode")]    public virtual Organisation Organisation { get; set; }    [ForeignKey("TierId")]    public virtual Tier Tier { get; set; }    [ForeignKey("GroupTypeId")]    public virtual GroupType GroupType { get; set; }    [InverseProperty("GroupId")]    public virtual IList<GroupToUnitLink> UnitLinks { get; set; }    [InverseProperty("GroupId")]    public virtual IList<GroupToContactLink> ContactLinks { get; set; }}
查看完整描述

2 回答

?
MMTTMM

TA貢獻(xiàn)1869條經(jīng)驗(yàn) 獲得超4個(gè)贊

您的問(wèn)題是 inverse 屬性不是 GroupToContactLink 類上引用 Contact 類的字段。

[InverseProperty("ContactId")] // Wrong: don't use the field

但引用 Contact 類的是 GroupToContactLink 類上的導(dǎo)航屬性。

[InverseProperty("Contact")] // Correct: use the navigation property


查看完整回答
反對(duì) 回復(fù) 2021-07-10
  • 2 回答
  • 0 關(guān)注
  • 175 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)