Commit 768a118 1 parent a79f41a commit 768a118 Copy full SHA for 768a118
File tree 3 files changed +15
-2
lines changed
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 14
14
15
15
<ItemGroup >
16
16
<ProjectReference Include =" ..\..\..\src\NATS.Client.Hosting\NATS.Client.Hosting.csproj" />
17
+ <ProjectReference Include =" ..\..\..\src\NATS.Client.Serializers.Json\NATS.Client.Serializers.Json.csproj" />
17
18
<ProjectReference Include =" ..\Shared\BlazorWasm.Shared.csproj" />
18
19
</ItemGroup >
19
20
Original file line number Diff line number Diff line change 3
3
using Microsoft . AspNetCore . Components . WebAssembly . Hosting ;
4
4
using NATS . Client . Core ;
5
5
using NATS . Client . Hosting ;
6
+ using NATS . Client . Serializers . Json ;
6
7
7
8
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
8
9
builder . RootComponents . Add < App > ( "#app" ) ;
9
10
builder . RootComponents . Add < HeadOutlet > ( "head::after" ) ;
10
11
11
- builder . Services . AddNats ( configureOpts : opt => opt with { Url = "ws://localhost:4280" , Name = "BlazorClient" } ) ;
12
+ builder . Services . AddNats ( configureOpts : opt => opt with
13
+ {
14
+ SerializerRegistry = NatsJsonSerializerRegistry . Default ,
15
+ Url = "ws://localhost:8080" ,
16
+ Name = "BlazorClient" ,
17
+ } ) ;
12
18
13
19
await builder . Build ( ) . RunAsync ( ) ;
Original file line number Diff line number Diff line change 1
1
using BlazorWasm . Server . NatsServices ;
2
2
using NATS . Client . Core ;
3
3
using NATS . Client . Hosting ;
4
+ using NATS . Client . Serializers . Json ;
4
5
5
6
var builder = WebApplication . CreateBuilder ( args ) ;
6
7
7
8
// Add services to the container.
8
9
builder . Services . AddControllersWithViews ( ) ;
9
10
builder . Services . AddRazorPages ( ) ;
10
- builder . Services . AddNats ( configureOpts : opt => opt with { Url = "localhost:4222" , Name = "BlazorServer" } ) ;
11
+ builder . Services . AddNats ( configureOpts : opt => opt with
12
+ {
13
+ SerializerRegistry = NatsJsonSerializerRegistry . Default ,
14
+ Url = "localhost:4222" ,
15
+ Name = "BlazorServer" ,
16
+ } ) ;
11
17
builder . Services . AddHostedService < WeatherForecastService > ( ) ;
12
18
13
19
var app = builder . Build ( ) ;
You can’t perform that action at this time.
0 commit comments