File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1022,6 +1022,25 @@ from c in db.Customers
1022
1022
}
1023
1023
}
1024
1024
1025
+ [ Category ( "JOIN" ) ]
1026
+ [ Test ( Description = "This sample joins two tables and projects results from the first table." ) ]
1027
+ public async Task DLinqJoin5eAsync ( )
1028
+ {
1029
+ var q =
1030
+ from c in db . Customers
1031
+ join o in db . Orders on c . CustomerId equals o . Customer . CustomerId
1032
+ where c . ContactName != null
1033
+ select o ;
1034
+
1035
+ using ( var sqlSpy = new SqlLogSpy ( ) )
1036
+ {
1037
+ await ( ObjectDumper . WriteAsync ( q ) ) ;
1038
+
1039
+ var sql = sqlSpy . GetWholeLog ( ) ;
1040
+ Assert . That ( GetTotalOccurrences ( sql , "inner join" ) , Is . EqualTo ( 1 ) ) ;
1041
+ }
1042
+ }
1043
+
1025
1044
[ Category ( "JOIN" ) ]
1026
1045
[ Test ( Description = "This sample explictly joins three tables and projects results from each of them." ) ]
1027
1046
public async Task DLinqJoin6Async ( )
Original file line number Diff line number Diff line change @@ -1566,6 +1566,25 @@ from c in db.Customers
1566
1566
}
1567
1567
}
1568
1568
1569
+ [ Category ( "JOIN" ) ]
1570
+ [ Test ( Description = "This sample joins two tables and projects results from the first table." ) ]
1571
+ public void DLinqJoin5e ( )
1572
+ {
1573
+ var q =
1574
+ from c in db . Customers
1575
+ join o in db . Orders on c . CustomerId equals o . Customer . CustomerId
1576
+ where c . ContactName != null
1577
+ select o ;
1578
+
1579
+ using ( var sqlSpy = new SqlLogSpy ( ) )
1580
+ {
1581
+ ObjectDumper . Write ( q ) ;
1582
+
1583
+ var sql = sqlSpy . GetWholeLog ( ) ;
1584
+ Assert . That ( GetTotalOccurrences ( sql , "inner join" ) , Is . EqualTo ( 1 ) ) ;
1585
+ }
1586
+ }
1587
+
1569
1588
[ Category ( "JOIN" ) ]
1570
1589
[ Test ( Description = "This sample explictly joins three tables and projects results from each of them." ) ]
1571
1590
public void DLinqJoin6 ( )
You can’t perform that action at this time.
0 commit comments