Strange behavior of INCLUDE in Entity Framework

后端 未结 2 1051
后悔当初
后悔当初 2021-01-24 14:02

This works:

using (var dbContext = new SmartDataContext())
{
    dbContext.Configuration.ProxyCreationEnabled = false;

    var query = dbContext.EntityMasters.O         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-24 14:13

    You need to assign the result of Include back to query

    query = query.Include(p => p.Addresses);
    

提交回复
热议问题