2017-02-28 20 views
2

をバインドできませんでした私は、次のエンティティ持っEFコア式が

 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. 

このエラーの原因を突き止めることはできません。オンラインで多くの情報を見つけることができません。ありがとう。

答えて

4
I tested with console app you just need to add get and set. 

    [Table("WFPP")] 
    public class WFPP 
    { 
     public WFPP() 
     { 
      AgencyList = new List<PlanningUnit>(); 
     } 

     public int Id { get; set; } 

     /// your are missing get and set 
     public ICollection<PlanningUnit> AgencyList { get; set; } 

    } 
+0

ワウ。その日の一つ。奇妙なエラーをあなたが紛失している簡単なものと結びつけるのは難しい場合もあります。どうもありがとうございます! –

+0

@JohnEdwardsようこそ。 –