3

I read the documentation and I see that the limitation when using IncludeFilter is that I can't combine it with EF Include. Has anyone came into this situation where they used IncludeFilter but needed to load a navigation property that originally would have been handled by EF Include? What's the best way to load the additional navigation property?

https://entityframework-plus.net/query-include-filter

Yim Yean
  • 53
  • 6

1 Answers1

3

It's currently impossible to combine IncludeFilter and Include. That's a limitation of our library.

However, you can use IncludeFilter without a filter. So to make it work, you just need to replace ALL include by IncludeFilter no matter if there is a filter or not.

Jonathan Magnan
  • 10,874
  • 2
  • 38
  • 60
  • I thought the library got updated to latest version 1.8.25 but it looked like the project was still on version 1.2.5. After confirming that the update was successful I tried the IncludeFilter again and this time I got the expected result. – Yim Yean May 15 '19 at 17:40
  • Is it possible to filter non-IQueryable like a reference type. For example; I want to have Address Entity on Customer only if its Active property set to True? I tried this: "context.Filter
    (a=> a.Where(b=>b.Active))". It does not apply while using IncludeFilter(a=>a.Address)
    – T.Y. Kucuk Nov 04 '19 at 09:14
  • Is this still a limitation on 2021? – The One Sep 08 '21 at 21:12