@@ -104,6 +104,9 @@ private static readonly PropertyInfo Utf8JsonReaderTokenTypeProperty
104104 private static readonly MethodInfo PropertyGetTypeMappingMethod =
105105 typeof ( IReadOnlyProperty ) . GetMethod ( nameof ( IReadOnlyProperty . GetTypeMapping ) , [ ] ) ! ;
106106
107+ private static readonly PropertyInfo QueryContextQueryLoggerProperty =
108+ typeof ( QueryContext ) . GetProperty ( nameof ( QueryContext . QueryLogger ) ) ! ;
109+
107110 private readonly RelationalShapedQueryCompilingExpressionVisitor _parentVisitor ;
108111 private readonly ISet < string > ? _tags ;
109112 private readonly bool _isTracking ;
@@ -1738,9 +1741,7 @@ private Expression CreateJsonShapers(
17381741 jsonReaderDataShaperLambdaParameter ,
17391742 innerShapersMap ,
17401743 innerFixupMap ,
1741- trackingInnerFixupMap ,
1742- _queryLogger ,
1743- _parentVisitor . Dependencies . LiftableConstantFactory ) . Rewrite ( structuralTypeShaperMaterializer ) ;
1744+ trackingInnerFixupMap ) . Rewrite ( structuralTypeShaperMaterializer ) ;
17441745
17451746 var entityShaperMaterializerVariable = Variable (
17461747 structuralTypeShaperMaterializer . Type ,
@@ -1889,9 +1890,7 @@ private sealed class JsonEntityMaterializerRewriter(
18891890 ParameterExpression jsonReaderDataParameter ,
18901891 IDictionary < string , Expression > innerShapersMap ,
18911892 IDictionary < string , LambdaExpression > innerFixupMap ,
1892- IDictionary < string , LambdaExpression > trackingInnerFixupMap ,
1893- IDiagnosticsLogger < DbLoggerCategory . Query > queryLogger ,
1894- ILiftableConstantFactory liftableConstantFactory )
1893+ IDictionary < string , LambdaExpression > trackingInnerFixupMap )
18951894 : ExpressionVisitor
18961895 {
18971896 private static readonly PropertyInfo JsonEncodedTextEncodedUtf8BytesProperty
@@ -2013,11 +2012,7 @@ protected override Expression VisitSwitch(SwitchExpression switchExpression)
20132012 New (
20142013 JsonReaderManagerConstructor ,
20152014 jsonReaderDataParameter ,
2016- liftableConstantFactory . CreateLiftableConstant (
2017- queryLogger ,
2018- static c => c . Dependencies . QueryLogger ,
2019- "queryLogger" ,
2020- typeof ( IDiagnosticsLogger < DbLoggerCategory . Query > ) ) ) ) ,
2015+ MakeMemberAccess ( QueryCompilationContext . QueryContextParameter , QueryContextQueryLoggerProperty ) ) ) ,
20212016 // tokenType = jsonReaderManager.CurrentReader.TokenType
20222017 Assign (
20232018 tokenTypeVariable ,
@@ -2208,11 +2203,7 @@ void ProcessFixup(IDictionary<string, LambdaExpression> fixupMap)
22082203 New (
22092204 JsonReaderManagerConstructor ,
22102205 jsonReaderDataParameter ,
2211- liftableConstantFactory . CreateLiftableConstant (
2212- queryLogger ,
2213- static c => c . Dependencies . QueryLogger ,
2214- "queryLogger" ,
2215- typeof ( IDiagnosticsLogger < DbLoggerCategory . Query > ) ) ) ) ;
2206+ MakeMemberAccess ( QueryCompilationContext . QueryContextParameter , QueryContextQueryLoggerProperty ) ) ) ;
22162207
22172208 readExpressions . Add (
22182209 Block (
@@ -2605,11 +2596,7 @@ internal ParameterExpression GenerateJsonReader(int jsonColumnIndex, ITypeBase s
26052596 New (
26062597 JsonReaderManagerConstructor ,
26072598 jsonReaderDataVariable ,
2608- _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
2609- _queryLogger ,
2610- static c => c . Dependencies . QueryLogger ,
2611- "queryLogger" ,
2612- typeof ( IDiagnosticsLogger < DbLoggerCategory . Query > ) ) ) ) ,
2599+ MakeMemberAccess ( QueryCompilationContext . QueryContextParameter , QueryContextQueryLoggerProperty ) ) ) ,
26132600 Call ( jsonReaderManagerVariable , Utf8JsonReaderManagerMoveNextMethod ) ,
26142601 Call ( jsonReaderManagerVariable , Utf8JsonReaderManagerCaptureStateMethod ) ) ) ;
26152602
0 commit comments