Skip to content

Commit ad2cb65

Browse files
committed
Add Add NServiceBus 10 version of the SystemJson snippets
1 parent a9aa5e6 commit ad2cb65

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net10.0</TargetFramework>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageReference Include="NServiceBus" Version="10.0.0-alpha.3" />
7+
</ItemGroup>
8+
</Project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System.Text.Json;
2+
using NServiceBus;
3+
4+
class SystemJsonSerializerUsage
5+
{
6+
SystemJsonSerializerUsage(EndpointConfiguration endpointConfiguration)
7+
{
8+
#region SystemJsonSerialization
9+
10+
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
11+
12+
#endregion
13+
14+
15+
#region SystemJsonContentType
16+
17+
endpointConfiguration.UseSerialization<SystemJsonSerializer>()
18+
.ContentType("application/json; systemjson");
19+
20+
#endregion
21+
22+
#region SystemJsonOptions
23+
24+
var jsonSerializerOptions = new JsonSerializerOptions
25+
{
26+
WriteIndented = true
27+
};
28+
29+
endpointConfiguration.UseSerialization<SystemJsonSerializer>()
30+
.Options(jsonSerializerOptions);
31+
32+
#endregion
33+
}
34+
}

Snippets/SystemJson/Core_10/prerelease.txt

Whitespace-only changes.

Snippets/SystemJson/SystemJson.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core_8.1", "Core_8.1\Core_8
66
EndProject
77
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core_9", "Core_9\Core_9.csproj", "{ADEEAF41-FEDA-4D6E-A3E6-37E0F5BC6E69}"
88
EndProject
9+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core_10", "Core_10\Core_10.csproj", "{CB9FEB38-27AF-4648-9222-28350BCED892}"
10+
EndProject
911
Global
1012
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1113
Debug|Any CPU = Debug|Any CPU
@@ -20,6 +22,10 @@ Global
2022
{ADEEAF41-FEDA-4D6E-A3E6-37E0F5BC6E69}.Debug|Any CPU.Build.0 = Debug|Any CPU
2123
{ADEEAF41-FEDA-4D6E-A3E6-37E0F5BC6E69}.Release|Any CPU.ActiveCfg = Release|Any CPU
2224
{ADEEAF41-FEDA-4D6E-A3E6-37E0F5BC6E69}.Release|Any CPU.Build.0 = Release|Any CPU
25+
{CB9FEB38-27AF-4648-9222-28350BCED892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{CB9FEB38-27AF-4648-9222-28350BCED892}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{CB9FEB38-27AF-4648-9222-28350BCED892}.Release|Any CPU.ActiveCfg = Release|Any CPU
28+
{CB9FEB38-27AF-4648-9222-28350BCED892}.Release|Any CPU.Build.0 = Release|Any CPU
2329
EndGlobalSection
2430
GlobalSection(SolutionProperties) = preSolution
2531
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)