Linq/EF, Eager loading and GROUP BY issues

前端 未结 2 1480
说谎
说谎 2021-01-04 10:02

I\'m having issues with GROUP BY and eager loading. I try to explain what im doing. I\'m querying a datacontext ctx for events

The event class has the following pr

2条回答
  •  轮回少年
    2021-01-04 10:35

    You're projecting onto an anonymous type, so Include() isn't going to work like that. Because what you've done with the group and projecting into the anonymous type is to change the shape of the query. That tosses out the eager loading. Reading this article might help.

提交回复
热议问题