EntityFrameworkCore.Projectables icon indicating copy to clipboard operation
EntityFrameworkCore.Projectables copied to clipboard

Not working with HasQueryFilter

Open igorcamasso opened this issue 2 years ago • 2 comments

When we tried to use the projectable property with a global query filter on Entity<T>.HasQueryFilter(a=> a.projectableProperty), we got a The LINQ expression DbSet<T>().Where(n => n.projectableProperty == False) could not be translated. Is this a bug or a some limitation?

igorcamasso avatar Aug 17 '23 21:08 igorcamasso

Just tried to reproduce this and it indeed looks like a compatibility bug. I don't know yet how to fix this as the library is either extending IQueryCompiler or IQueryTranslationPreprocessorFactory (depending on compatibility mode) however it seems that query filters are a completely different beast. Fun fact: I just learned that dbContext.Set<Entity>().ToQueryString() does not expand query filters either.

koenbeuk avatar Aug 18 '23 00:08 koenbeuk