@@ -1307,6 +1307,9 @@ public void ExpressionTests_NullCoalescing()
1307
1307
}
1308
1308
1309
1309
[ Theory ]
1310
+ [ InlineData ( "np(str)" , "Select(Param_0 => Param_0.str)" ) ]
1311
+ [ InlineData ( "np(strNull)" , "Select(Param_0 => Param_0.strNull)" ) ]
1312
+ [ InlineData ( "np(str, \" x\" )" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.str != null)), Param_0.str, \" x\" ))" ) ]
1310
1313
[ InlineData ( "np(g)" , "Select(Param_0 => Param_0.g)" ) ]
1311
1314
[ InlineData ( "np(gnullable)" , "Select(Param_0 => Param_0.gnullable)" ) ]
1312
1315
[ InlineData ( "np(dt)" , "Select(Param_0 => Param_0.dt)" ) ]
@@ -1332,9 +1335,12 @@ public void ExpressionTests_NullCoalescing()
1332
1335
[ InlineData ( "np(item.GuidNormal)" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.item != null)), Convert(Param_0.item.GuidNormal, Nullable`1), null))" ) ]
1333
1336
#endif
1334
1337
1338
+ [ InlineData ( "np(nested.strNull)" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.nested != null)), Param_0.nested.strNull, null))" ) ]
1339
+ [ InlineData ( "np(nested.strNull, \" x\" )" , "Select(Param_0 => IIF((((Param_0 != null) AndAlso (Param_0.nested != null)) AndAlso (Param_0.nested.strNull != null)), Param_0.nested.strNull, \" x\" ))" ) ]
1335
1340
[ InlineData ( "np(nested.gnullable)" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.nested != null)), Param_0.nested.gnullable, null))" ) ]
1336
1341
[ InlineData ( "np(nested.dtnullable)" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.nested != null)), Param_0.nested.dtnullable, null))" ) ]
1337
1342
[ InlineData ( "np(nested.nullablenumber)" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.nested != null)), Param_0.nested.nullablenumber, null))" ) ]
1343
+ [ InlineData ( "np(nested.nullablenumber, 42)" , "Select(Param_0 => IIF((((Param_0 != null) AndAlso (Param_0.nested != null)) AndAlso (Param_0.nested.nullablenumber != null)), Param_0.nested.nullablenumber, 42))" ) ]
1338
1344
[ InlineData ( "np(nested._enumnullable)" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.nested != null)), Param_0.nested._enumnullable, null))" ) ]
1339
1345
[ InlineData ( "np(item.GuidNull)" , "Select(Param_0 => IIF(((Param_0 != null) AndAlso (Param_0.item != null)), Param_0.item.GuidNull, null))" ) ]
1340
1346
public void ExpressionTests_NullPropagating ( string test , string query )
@@ -1352,6 +1358,8 @@ public void ExpressionTests_NullPropagating(string test, string query)
1352
1358
_enumnullable = ( TestEnum2 ? ) TestEnum2 . Var2 ,
1353
1359
number = 1 ,
1354
1360
nullablenumber = ( int ? ) 2 ,
1361
+ str = "str" ,
1362
+ strNull = ( string ) null ,
1355
1363
nested = new
1356
1364
{
1357
1365
g = Guid . NewGuid ( ) ,
@@ -1362,6 +1370,8 @@ public void ExpressionTests_NullPropagating(string test, string query)
1362
1370
_enumnullable = ( TestEnum2 ? ) TestEnum2 . Var2 ,
1363
1371
number = 1 ,
1364
1372
nullablenumber = ( int ? ) 2 ,
1373
+ str = "str" ,
1374
+ strNull = ( string ) null
1365
1375
} ,
1366
1376
item = new TestGuidNullClass
1367
1377
{
0 commit comments