-
Notifications
You must be signed in to change notification settings - Fork 13
Expressions not working with global query filters #33
Copy link
Copy link
Open
Description
I'm trying to use Expressionify together with global query filters and it seems it is not working.
To reproduce:
- Create entity
Tenant - Create entity
User, which hasTenantandTenantIdproperty - Create entity
Product, which hasUserandUserIdproperty - Create Expressionify method
public static int GetTenantId(Product p) => p.User.TenantId;intoProductentity - In
DbContext.OnModelCreating(), add filter:modelBuilder.Entity<Product>().HasQueryFilter(x => x.GetTenantId() == 3);
Exception:
Message:
System.TypeLoadException : Method 'PrecompileQuery' in type 'Clave.Expressionify.ExpressionableQueryCompiler' from assembly 'Clave.Expressionify, Version=6.6.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Stack Trace:
ExpressionifyDbContextOptionsExtension.ApplyServices(IServiceCollection services)
ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services)
ServiceProviderCache.<GetOrAdd>g__BuildServiceProvider|4_1(IDbContextOptions _, ValueTuple`2 arguments)
<>c.<GetOrAdd>b__4_0(IDbContextOptions contextOptions, ValueTuple`2 tuples)
ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArgument)
ServiceProviderCache.GetOrAdd(IDbContextOptions options, Boolean providerRequired)
DbContext.get_ContextServices()
DbContext.get_InternalServiceProvider()
IServiceProvider>.get_Instance()
InfrastructureExtensions.GetService(IInfrastructure`1 accessor, Type serviceType)
InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)
AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)
DatabaseFacade.get_Dependencies()
IDatabaseFacadeDependenciesAccessor.get_Dependencies()
RelationalDatabaseFacadeExtensions.OpenConnection(DatabaseFacade databaseFacade)
AppDbContext.ctor() line 271
EntityFilterEfTests.CreateContext() line 226
EntityFilterEfTests.Products_TenantNotSet_Returns_AllProducts() line 155
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels