koenbeuk / EntityFrameworkCore.Projectables

Project over properties and functions in your linq queries
MIT License
260 stars 17 forks source link

Not working with HasQueryFilter #81

Open igorcamasso opened 11 months ago

igorcamasso commented 11 months ago

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?

koenbeuk commented 11 months ago

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.