Improve creation of RelationalCommandCache expression in RelationalShapedQueryCompilingExpressionVisitor
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
Create just empty `new HashSet(StringComparer.Ordinal)` and in 2nd step dynamically add the initializers as in `GenerateRelationalCommandCacheExpression`.
Original code:
```csharp
var commandLiftableConstant = RelationalDependencies.RelationalLiftableConstantFactory.CreateLiftableConstant(
relationalCommandCache,
c => new RelationalCommandCache(
c.Dependencies.MemoryCache,
c.RelationalDependencies.QuerySqlGeneratorFactory,
c.RelationalDependencies.RelationalParameterBasedSqlProcessorFactory,
queryExpression,
_useRelationalNulls,
),
"relationalCommandCache",
typeof(RelationalCommandCache));
```
Contributor guide
Assessment
This issue has not been assessed yet.