Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • It's more likely that the code doesn't even run. It's trying to assign an IQueryable to a List<T> variable. This should throw Commented Sep 6, 2018 at 8:46
  • @PanagiotisKanavos No, OP stated that he changed the type to IQueryable and removed ToList() method. As can be also seen in [pictures, code runs well. Commented Sep 6, 2018 at 8:48
  • 1
    The screenshots don't match the code. They are from a different snippet entirely. The OP doesn't explain what changes were made - IQueryable doesn't have a .Count property. If ValueTypes is still a list, how was an IQueryable assigned to it? And since ValueTypes contains the query's root results its count wouldn't be affected by lazy loading Commented Sep 6, 2018 at 8:55