dotnet / dotnet/efcore

Check why we avoid parameterizing indexer method parameters in the funcletizer

Open
#34,733 2 comments 0 reactions 0 assignees View on GitHub
area-query customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

We have the following code in [ExpressionTreeFuncletizer](https://github.com/dotnet/efcore/blob/main/src/EFCore/Query/Internal/ExpressionTreeFuncletizer.cs#L2112):

```c#
private bool IsParameterParameterizable(MethodInfo method, ParameterInfo parameter)
=> parameter.GetCustomAttribute() is null
&& !_model.IsIndexerMethod(method);
```

... which means that we constantize arguments to what we identify as indexers (also not sure why the model needs to be involved in determining that something is an indexer...).

For example, this prevents parameters from being parameterized when using the PostgreSQL hstore type, which maps to `Dictionary` (see https://github.com/npgsql/efcore.pg/pull/3285#discussion_r1767499647).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.