File tree Expand file tree Collapse file tree 8 files changed +36
-86
lines changed Expand file tree Collapse file tree 8 files changed +36
-86
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- using Client ;
21using Microsoft . Extensions . DependencyInjection ;
32using Microsoft . Extensions . Hosting ;
43
54Console . Title = "Client" ;
65var builder = Host . CreateApplicationBuilder ( args ) ;
7- builder . Services . AddHostedService < InputLoopService > ( ) ;
6+
87var endpointConfiguration = new EndpointConfiguration ( "Samples.Unobtrusive.Client" ) ;
98endpointConfiguration . UseSerialization < SystemJsonSerializer > ( ) ;
109endpointConfiguration . UseTransport ( new LearningTransport ( ) ) ;
1514
1615builder . UseNServiceBus ( endpointConfiguration ) ;
1716
18- await builder . Build ( ) . RunAsync ( ) ;
17+ var host = builder . Build ( ) ;
18+
19+ await host . StartAsync ( ) ;
20+
21+ var messageSession = host . Services . GetRequiredService < IMessageSession > ( ) ;
22+ await CommandSender . Start ( messageSession ) ;
23+
24+ await host . StopAsync ( ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11using Microsoft . Extensions . DependencyInjection ;
22using Microsoft . Extensions . Hosting ;
3- using Server ;
43
54Console . Title = "Server" ;
65var builder = Host . CreateApplicationBuilder ( args ) ;
7- builder . Services . AddHostedService < InputLoopService > ( ) ;
86
97var endpointConfiguration = new EndpointConfiguration ( "Samples.Unobtrusive.Server" ) ;
108endpointConfiguration . UseSerialization < SystemJsonSerializer > ( ) ;
1614
1715builder . UseNServiceBus ( endpointConfiguration ) ;
1816
19- await builder . Build ( ) . RunAsync ( ) ;
17+ var host = builder . Build ( ) ;
18+
19+ await host . StartAsync ( ) ;
20+
21+ var messageSession = host . Services . GetRequiredService < IMessageSession > ( ) ;
22+ await CommandSender . Start ( messageSession ) ;
23+
24+ await host . StopAsync ( ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- using Client ;
21using Microsoft . Extensions . DependencyInjection ;
32using Microsoft . Extensions . Hosting ;
43
54Console . Title = "Client" ;
65var builder = Host . CreateApplicationBuilder ( args ) ;
7- builder . Services . AddHostedService < InputLoopService > ( ) ;
6+
87var endpointConfiguration = new EndpointConfiguration ( "Samples.Unobtrusive.Client" ) ;
98endpointConfiguration . UseSerialization < SystemJsonSerializer > ( ) ;
109endpointConfiguration . UseTransport ( new LearningTransport ( ) ) ;
1110#pragma warning disable CS0618 // Type or member is obsolete
12- var dataBus = endpointConfiguration . UseDataBus < FileShareDataBus , SystemJsonDataBusSerializer > ( ) ;
13- dataBus . BasePath ( @"..\..\..\..\DataBusShare\" ) ;
11+ endpointConfiguration . UseDataBus < FileShareDataBus , SystemJsonDataBusSerializer > ( )
12+ . BasePath ( @"..\..\..\..\DataBusShare\" ) ;
1413#pragma warning restore CS0618 // Type or member is obsolete
1514
1615endpointConfiguration . ApplyCustomConventions ( ) ;
1716
1817builder . UseNServiceBus ( endpointConfiguration ) ;
1918
20- await builder . Build ( ) . RunAsync ( ) ;
19+ var host = builder . Build ( ) ;
20+
21+ await host . StartAsync ( ) ;
22+
23+ var messageSession = host . Services . GetRequiredService < IMessageSession > ( ) ;
24+ await CommandSender . Start ( messageSession ) ;
25+
26+ await host . StopAsync ( ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11using Microsoft . Extensions . DependencyInjection ;
22using Microsoft . Extensions . Hosting ;
3- using Server ;
43
54Console . Title = "Server" ;
65var builder = Host . CreateApplicationBuilder ( args ) ;
7- builder . Services . AddHostedService < InputLoopService > ( ) ;
86
97var endpointConfiguration = new EndpointConfiguration ( "Samples.Unobtrusive.Server" ) ;
108endpointConfiguration . UseSerialization < SystemJsonSerializer > ( ) ;
1816
1917builder . UseNServiceBus ( endpointConfiguration ) ;
2018
21- await builder . Build ( ) . RunAsync ( ) ;
19+ var host = builder . Build ( ) ;
20+
21+ await host . StartAsync ( ) ;
22+
23+ var messageSession = host . Services . GetRequiredService < IMessageSession > ( ) ;
24+ await CommandSender . Start ( messageSession ) ;
25+
26+ await host . StopAsync ( ) ;
You can’t perform that action at this time.
0 commit comments