@@ -856,16 +856,40 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
856
856
QueryCompilationContext . QueryContextParameter ,
857
857
_dataReaderParameter ) ;
858
858
859
+ var parentIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
860
+ parentIdentifierLambda . Compile ( ) ,
861
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
862
+ parentIdentifierLambda ,
863
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
864
+ "parentIdentifierLambda" ,
865
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
866
+
859
867
var outerIdentifierLambda = Lambda (
860
868
Visit ( relationalCollectionShaperExpression . OuterIdentifier ) ,
861
869
QueryCompilationContext . QueryContextParameter ,
862
870
_dataReaderParameter ) ;
863
871
872
+ var outerIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
873
+ outerIdentifierLambda . Compile ( ) ,
874
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
875
+ outerIdentifierLambda ,
876
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
877
+ "outerIdentifierLambda" ,
878
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
879
+
864
880
var selfIdentifierLambda = Lambda (
865
881
Visit ( relationalCollectionShaperExpression . SelfIdentifier ) ,
866
882
QueryCompilationContext . QueryContextParameter ,
867
883
_dataReaderParameter ) ;
868
884
885
+ var selfIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
886
+ selfIdentifierLambda . Compile ( ) ,
887
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
888
+ selfIdentifierLambda ,
889
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
890
+ "selfIdentifierLambda" ,
891
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
892
+
869
893
_inline = false ;
870
894
871
895
_includeExpressions . Add (
@@ -876,8 +900,8 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
876
900
_dataReaderParameter ,
877
901
_resultCoordinatorParameter ,
878
902
entity ,
879
- parentIdentifierLambda ,
880
- outerIdentifierLambda ,
903
+ parentIdentifierLambdaCompiled ,
904
+ outerIdentifierLambdaCompiled ,
881
905
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
882
906
navigation ,
883
907
LiftableConstantExpressionHelpers . BuildNavigationAccessLambda ( navigation ) ,
@@ -905,9 +929,9 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
905
929
QueryCompilationContext . QueryContextParameter ,
906
930
_dataReaderParameter ,
907
931
_resultCoordinatorParameter ,
908
- parentIdentifierLambda ,
909
- outerIdentifierLambda ,
910
- selfIdentifierLambda ,
932
+ parentIdentifierLambdaCompiled ,
933
+ outerIdentifierLambdaCompiled ,
934
+ selfIdentifierLambdaCompiled ,
911
935
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
912
936
relationalCollectionShaperExpression . ParentIdentifierValueComparers
913
937
. Select ( x => ( Func < object , object , bool > ) x . Equals ) . ToArray ( ) ,
@@ -980,6 +1004,14 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
980
1004
QueryCompilationContext . QueryContextParameter ,
981
1005
_dataReaderParameter ) ;
982
1006
1007
+ var parentIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1008
+ parentIdentifierLambda . Compile ( ) ,
1009
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
1010
+ parentIdentifierLambda ,
1011
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
1012
+ "parentIdentifierLambda" ,
1013
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
1014
+
983
1015
_inline = false ;
984
1016
985
1017
innerProcessor . _inline = true ;
@@ -989,6 +1021,14 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
989
1021
QueryCompilationContext . QueryContextParameter ,
990
1022
innerProcessor . _dataReaderParameter ) ;
991
1023
1024
+ var childIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1025
+ childIdentifierLambda . Compile ( ) ,
1026
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
1027
+ childIdentifierLambda ,
1028
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
1029
+ "childIdentifierLambda" ,
1030
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
1031
+
992
1032
innerProcessor . _inline = false ;
993
1033
994
1034
_includeExpressions . Add (
@@ -999,7 +1039,7 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
999
1039
_dataReaderParameter ,
1000
1040
_resultCoordinatorParameter ,
1001
1041
entity ,
1002
- parentIdentifierLambda ,
1042
+ parentIdentifierLambdaCompiled ,
1003
1043
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1004
1044
navigation ,
1005
1045
LiftableConstantExpressionHelpers . BuildNavigationAccessLambda ( navigation ) ,
@@ -1029,7 +1069,7 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1029
1069
CreateReaderColumnsExpression ( readerColumns , _parentVisitor . Dependencies . LiftableConstantFactory ) ,
1030
1070
Constant ( _detailedErrorsEnabled ) ,
1031
1071
_resultCoordinatorParameter ,
1032
- childIdentifierLambda ,
1072
+ childIdentifierLambdaCompiled ,
1033
1073
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1034
1074
relationalSplitCollectionShaperExpression . IdentifierValueComparers
1035
1075
. Select ( x => ( Func < object , object , bool > ) x . Equals ) . ToArray ( ) ,
@@ -1148,16 +1188,40 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1148
1188
QueryCompilationContext . QueryContextParameter ,
1149
1189
_dataReaderParameter ) ;
1150
1190
1191
+ var parentIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1192
+ parentIdentifierLambda . Compile ( ) ,
1193
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
1194
+ parentIdentifierLambda ,
1195
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
1196
+ "parentIdentifierLambda" ,
1197
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
1198
+
1151
1199
var outerIdentifierLambda = Lambda (
1152
1200
Visit ( relationalCollectionShaperExpression . OuterIdentifier ) ,
1153
1201
QueryCompilationContext . QueryContextParameter ,
1154
1202
_dataReaderParameter ) ;
1155
1203
1204
+ var outerIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1205
+ outerIdentifierLambda . Compile ( ) ,
1206
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
1207
+ outerIdentifierLambda ,
1208
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
1209
+ "outerIdentifierLambda" ,
1210
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
1211
+
1156
1212
var selfIdentifierLambda = Lambda (
1157
1213
Visit ( relationalCollectionShaperExpression . SelfIdentifier ) ,
1158
1214
QueryCompilationContext . QueryContextParameter ,
1159
1215
_dataReaderParameter ) ;
1160
1216
1217
+ var selfIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1218
+ selfIdentifierLambda . Compile ( ) ,
1219
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
1220
+ selfIdentifierLambda ,
1221
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
1222
+ "selfIdentifierLambda" ,
1223
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
1224
+
1161
1225
_inline = false ;
1162
1226
1163
1227
var collectionParameter = Parameter ( relationalCollectionShaperExpression . Type ) ;
@@ -1171,8 +1235,8 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1171
1235
QueryCompilationContext . QueryContextParameter ,
1172
1236
_dataReaderParameter ,
1173
1237
_resultCoordinatorParameter ,
1174
- parentIdentifierLambda ,
1175
- outerIdentifierLambda ,
1238
+ parentIdentifierLambdaCompiled ,
1239
+ outerIdentifierLambdaCompiled ,
1176
1240
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1177
1241
collectionAccessor ,
1178
1242
LiftableConstantExpressionHelpers . BuildClrCollectionAccessorLambda ( navigation ) ,
@@ -1193,9 +1257,9 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1193
1257
QueryCompilationContext . QueryContextParameter ,
1194
1258
_dataReaderParameter ,
1195
1259
_resultCoordinatorParameter ,
1196
- parentIdentifierLambda ,
1197
- outerIdentifierLambda ,
1198
- selfIdentifierLambda ,
1260
+ parentIdentifierLambdaCompiled ,
1261
+ outerIdentifierLambdaCompiled ,
1262
+ selfIdentifierLambdaCompiled ,
1199
1263
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1200
1264
relationalCollectionShaperExpression . ParentIdentifierValueComparers
1201
1265
. Select ( x => ( Func < object , object , bool > ) x . Equals ) . ToArray ( ) ,
@@ -1265,6 +1329,14 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1265
1329
QueryCompilationContext . QueryContextParameter ,
1266
1330
_dataReaderParameter ) ;
1267
1331
1332
+ var parentIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1333
+ parentIdentifierLambda . Compile ( ) ,
1334
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
1335
+ parentIdentifierLambda ,
1336
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
1337
+ "parentIdentifierLambda" ,
1338
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
1339
+
1268
1340
_inline = false ;
1269
1341
1270
1342
innerProcessor . _inline = true ;
@@ -1274,6 +1346,14 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1274
1346
QueryCompilationContext . QueryContextParameter ,
1275
1347
innerProcessor . _dataReaderParameter ) ;
1276
1348
1349
+ var childIdentifierLambdaCompiled = _parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1350
+ childIdentifierLambda . Compile ( ) ,
1351
+ Lambda < Func < MaterializerLiftableConstantContext , object > > (
1352
+ childIdentifierLambda ,
1353
+ Parameter ( typeof ( MaterializerLiftableConstantContext ) , "_" ) ) ,
1354
+ "childIdentifierLambda" ,
1355
+ typeof ( Func < QueryContext , DbDataReader , object [ ] > ) ) ;
1356
+
1277
1357
innerProcessor . _inline = false ;
1278
1358
1279
1359
var collectionParameter = Parameter ( collectionType ) ;
@@ -1288,7 +1368,7 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1288
1368
QueryCompilationContext . QueryContextParameter ,
1289
1369
_dataReaderParameter ,
1290
1370
_resultCoordinatorParameter ,
1291
- parentIdentifierLambda ,
1371
+ parentIdentifierLambdaCompiled ,
1292
1372
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1293
1373
collectionAccessor ,
1294
1374
LiftableConstantExpressionHelpers . BuildClrCollectionAccessorLambda ( navigation ) ,
@@ -1313,7 +1393,7 @@ when GetProjectionIndex(collectionResultExpression.ProjectionBindingExpression)
1313
1393
CreateReaderColumnsExpression ( readerColumns , _parentVisitor . Dependencies . LiftableConstantFactory ) ,
1314
1394
Constant ( _detailedErrorsEnabled ) ,
1315
1395
_resultCoordinatorParameter ,
1316
- childIdentifierLambda ,
1396
+ childIdentifierLambdaCompiled ,
1317
1397
_parentVisitor . Dependencies . LiftableConstantFactory . CreateLiftableConstant (
1318
1398
relationalSplitCollectionShaperExpression . IdentifierValueComparers
1319
1399
. Select ( x => ( Func < object , object , bool > ) x . Equals ) . ToArray ( ) ,
0 commit comments