Entity Framework Include() is not working within complex query

后端 未结 4 645
-上瘾入骨i
-上瘾入骨i 2020-12-03 15:11

Consider following LINQ query:

var item = (from obj in _db.SampleEntity.Include(s => s.NavProp1)
           select new
           {
                ItemPr         


        
4条回答
  •  再見小時候
    2020-12-03 15:34

    I know this will probably get a few laughs, but don't forget the obvious like i just did. The row in the database didn't actually have a foreign key reference! I should have checked the dam data first before thinking EF Include wasn't working! Grrr. 30 minutes of my life I won't get back.

提交回复
热议问题