Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ private static readonly PropertyInfo Utf8JsonReaderTokenTypeProperty
private static readonly MethodInfo PropertyGetTypeMappingMethod =
typeof(IReadOnlyProperty).GetMethod(nameof(IReadOnlyProperty.GetTypeMapping), [])!;

private static readonly PropertyInfo QueryContextQueryLoggerProperty =
typeof(QueryContext).GetProperty(nameof(QueryContext.QueryLogger))!;

private readonly RelationalShapedQueryCompilingExpressionVisitor _parentVisitor;
private readonly ISet<string>? _tags;
private readonly bool _isTracking;
Expand Down Expand Up @@ -1738,9 +1741,7 @@ private Expression CreateJsonShapers(
jsonReaderDataShaperLambdaParameter,
innerShapersMap,
innerFixupMap,
trackingInnerFixupMap,
_queryLogger,
_parentVisitor.Dependencies.LiftableConstantFactory).Rewrite(structuralTypeShaperMaterializer);
trackingInnerFixupMap).Rewrite(structuralTypeShaperMaterializer);

var entityShaperMaterializerVariable = Variable(
structuralTypeShaperMaterializer.Type,
Expand Down Expand Up @@ -1889,9 +1890,7 @@ private sealed class JsonEntityMaterializerRewriter(
ParameterExpression jsonReaderDataParameter,
IDictionary<string, Expression> innerShapersMap,
IDictionary<string, LambdaExpression> innerFixupMap,
IDictionary<string, LambdaExpression> trackingInnerFixupMap,
IDiagnosticsLogger<DbLoggerCategory.Query> queryLogger,
ILiftableConstantFactory liftableConstantFactory)
IDictionary<string, LambdaExpression> trackingInnerFixupMap)
: ExpressionVisitor
{
private static readonly PropertyInfo JsonEncodedTextEncodedUtf8BytesProperty
Expand Down Expand Up @@ -2013,11 +2012,7 @@ protected override Expression VisitSwitch(SwitchExpression switchExpression)
New(
JsonReaderManagerConstructor,
jsonReaderDataParameter,
liftableConstantFactory.CreateLiftableConstant(
queryLogger,
static c => c.Dependencies.QueryLogger,
"queryLogger",
typeof(IDiagnosticsLogger<DbLoggerCategory.Query>)))),
MakeMemberAccess(QueryCompilationContext.QueryContextParameter, QueryContextQueryLoggerProperty))),
// tokenType = jsonReaderManager.CurrentReader.TokenType
Assign(
tokenTypeVariable,
Expand Down Expand Up @@ -2208,11 +2203,7 @@ void ProcessFixup(IDictionary<string, LambdaExpression> fixupMap)
New(
JsonReaderManagerConstructor,
jsonReaderDataParameter,
liftableConstantFactory.CreateLiftableConstant(
queryLogger,
static c => c.Dependencies.QueryLogger,
"queryLogger",
typeof(IDiagnosticsLogger<DbLoggerCategory.Query>))));
MakeMemberAccess(QueryCompilationContext.QueryContextParameter, QueryContextQueryLoggerProperty)));

readExpressions.Add(
Block(
Expand Down Expand Up @@ -2605,11 +2596,7 @@ internal ParameterExpression GenerateJsonReader(int jsonColumnIndex, ITypeBase s
New(
JsonReaderManagerConstructor,
jsonReaderDataVariable,
_parentVisitor.Dependencies.LiftableConstantFactory.CreateLiftableConstant(
_queryLogger,
static c => c.Dependencies.QueryLogger,
"queryLogger",
typeof(IDiagnosticsLogger<DbLoggerCategory.Query>)))),
MakeMemberAccess(QueryCompilationContext.QueryContextParameter, QueryContextQueryLoggerProperty))),
Call(jsonReaderManagerVariable, Utf8JsonReaderManagerMoveNextMethod),
Call(jsonReaderManagerVariable, Utf8JsonReaderManagerCaptureStateMethod)));

Expand Down
Loading