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

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

實(shí)體框架-包括多個(gè)屬性級(jí)別

實(shí)體框架-包括多個(gè)屬性級(jí)別

LEATH 2019-07-06 15:13:31
實(shí)體框架-包括多個(gè)屬性級(jí)別include()方法對(duì)于對(duì)象上的列表非常有效。但如果我需要深入兩層呢?例如,下面的方法將返回ApplicationServers,其中包含這里顯示的屬性。但是,ApplicationsWithOverrideGroup是另一個(gè)包含其他復(fù)雜對(duì)象的容器。我也可以在那個(gè)屬性上做一個(gè)include()嗎?或者如何使該屬性完全加載?目前,這種方法:public IEnumerable<ApplicationServer> GetAll(){     return this.Database.ApplicationServers         .Include(x => x.ApplicationsWithOverrideGroup)                         .Include(x => x.ApplicationWithGroupToForceInstallList)         .Include(x => x.CustomVariableGroups)                         .ToList();}只填充已啟用的屬性(下面),而不填充Application或CustomVariableGroup屬性(如下)。我該怎么做?public class ApplicationWithOverrideVariableGroup : EntityBase{     public bool Enabled { get; set; }     public Application Application { get; set; }     public CustomVariableGroup CustomVariableGroup { get; set; }}
查看完整描述

3 回答

?
慕蓋茨4494581

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

如果我正確地理解了您,那么您將詢問是否包含嵌套屬性。如果是這樣的話:

.Include(x => x.ApplicationsWithOverrideGroup.NestedProp)

.Include("ApplicationsWithOverrideGroup.NestedProp")

.Include($"{nameof(ApplicationsWithOverrideGroup)}.{nameof(NestedProp)}")


查看完整回答
反對(duì) 回復(fù) 2019-07-06
  • 3 回答
  • 0 關(guān)注
  • 470 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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