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 @@ -1072,6 +1072,25 @@ join c in db.Customers on
1072
1072
}
1073
1073
}
1074
1074
1075
+ [ Category ( "JOIN" ) ]
1076
+ [ Test ( Description = "This sample joins two tables and projects results from the first table." ) ]
1077
+ public async Task DLinqJoin5eAsync ( )
1078
+ {
1079
+ var q =
1080
+ from c in db . Customers
1081
+ join o in db . Orders on c . CustomerId equals o . Customer . CustomerId
1082
+ where c . ContactName != null
1083
+ select o ;
1084
+
1085
+ using ( var sqlSpy = new SqlLogSpy ( ) )
1086
+ {
1087
+ await ( ObjectDumper . WriteAsync ( q ) ) ;
1088
+
1089
+ var sql = sqlSpy . GetWholeLog ( ) ;
1090
+ Assert . That ( GetTotalOccurrences ( sql , "inner join" ) , Is . EqualTo ( 1 ) ) ;
1091
+ }
1092
+ }
1093
+
1075
1094
[ Category ( "JOIN" ) ]
1076
1095
[ Test ( Description = "This sample explictly joins three tables and projects results from each of them." ) ]
1077
1096
public async Task DLinqJoin6Async ( )
Original file line number Diff line number Diff line change @@ -1616,6 +1616,25 @@ join c in db.Customers on
1616
1616
}
1617
1617
}
1618
1618
1619
+ [ Category ( "JOIN" ) ]
1620
+ [ Test ( Description = "This sample joins two tables and projects results from the first table." ) ]
1621
+ public void DLinqJoin5e ( )
1622
+ {
1623
+ var q =
1624
+ from c in db . Customers
1625
+ join o in db . Orders on c . CustomerId equals o . Customer . CustomerId
1626
+ where c . ContactName != null
1627
+ select o ;
1628
+
1629
+ using ( var sqlSpy = new SqlLogSpy ( ) )
1630
+ {
1631
+ ObjectDumper . Write ( q ) ;
1632
+
1633
+ var sql = sqlSpy . GetWholeLog ( ) ;
1634
+ Assert . That ( GetTotalOccurrences ( sql , "inner join" ) , Is . EqualTo ( 1 ) ) ;
1635
+ }
1636
+ }
1637
+
1619
1638
[ Category ( "JOIN" ) ]
1620
1639
[ Test ( Description = "This sample explictly joins three tables and projects results from each of them." ) ]
1621
1640
public void DLinqJoin6 ( )
You can’t perform that action at this time.
0 commit comments