2
我有以下實體:EF核表達無法綁定
public DbSet<WFPP> WFPPs { get; set; }
....
[Table("PlanningUnit")]
public class PlanningUnit
{
public PlanningUnit()
{
}
public int PlanningUnitId { get; set; }
public Region Region { get; set; }
}
[Table("WFPP")]
public class WFPP
{
public WFPP()
{
AgencyList = new List<PlanningUnit>();
}
public int Id { get; set; }
public List<PlanningUnit> AgencyList;
}
我嘗試如下加載實體:
var test= _context.WFPPs.Where(x => x.Id==0).Include(x => x.AgencyList).ToList();
而且我得到以下錯誤:
The expression '[x].AgencyList' passed to the Include operator could not be bound.
我找不出是什麼原因導致了這個錯誤,我似乎無法在網上找到很多信息。謝謝。
哇。那些日子中的一天。有時很難將奇怪的錯誤與缺少的簡單事情聯繫起來。非常感謝! –
@JohnEdwards歡迎您。 –