File tree Expand file tree Collapse file tree 2 files changed +46
-2
lines changed
Samples/ksqlDB.RestApi.Client.Sample Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Original file line number Diff line number Diff line change
1
+ using ksqlDB . RestApi . Client . KSql . Linq ;
2
+ using ksqlDB . RestApi . Client . KSql . Query . Context ;
3
+
4
+ namespace ksqlDB . Api . Client . Samples . Joins
5
+ {
6
+ public class Joins
7
+ {
8
+ public Joins ( )
9
+ {
10
+ var ksqlDbUrl = @"http:\\localhost:8088" ;
11
+
12
+ var context = new KSqlDBContext ( ksqlDbUrl ) ;
13
+
14
+ var query = ( from o in context . CreateQueryStream < Order > ( )
15
+ join p1 in Source . Of < Payment > ( ) on o . PaymentId equals p1 . Id
16
+ join s1 in Source . Of < Shipment > ( ) on o . ShipmentId equals s1 . Id into gj
17
+ from sa in gj . DefaultIfEmpty ( )
18
+ select new
19
+ {
20
+ orderId = o . OrderId ,
21
+ shipmentId = sa . Id ,
22
+ paymentId = p1 . Id ,
23
+ } )
24
+ . Take ( 5 ) ;
25
+ }
26
+ }
27
+
28
+ class Order
29
+ {
30
+ public int OrderId { get ; set ; }
31
+ public int PaymentId { get ; set ; }
32
+ public int ShipmentId { get ; set ; }
33
+ }
34
+
35
+ class Payment
36
+ {
37
+ public int Id { get ; set ; }
38
+ }
39
+
40
+ record Shipment
41
+ {
42
+ public int Id { get ; set ; }
43
+ }
44
+ }
Original file line number Diff line number Diff line change 8
8
</PropertyGroup >
9
9
10
10
<ItemGroup >
11
- <PackageReference Include =" ksqlDB.RestApi.Client" Version =" 1.0.0-rc.1" />
11
+ <PackageReference Include =" ksqlDB.RestApi.Client" Version =" 1.1.0-rc.1" />
12
+ <!-- <ProjectReference Include="..\..\ksqlDb.RestApi.Client\ksqlDb.RestApi.Client.csproj" /> -->
12
13
<PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 5.0.1" />
13
- <!-- <ProjectReference Include="..\..\ksqlDb.RestApi.Client\ksqlDb.RestApi.Client.csproj" />-->
14
14
</ItemGroup >
15
15
</Project >
You can’t perform that action at this time.
0 commit comments