Skip to content

Commit

Permalink
Use source generation for the serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
lewing committed Oct 22, 2023
1 parent b9d8461 commit 768b65b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,6 @@
<MicrosoftSymbolStoreVersion>1.0.406601</MicrosoftSymbolStoreVersion>
<!-- installer version, for testing workloads -->
<MicrosoftDotnetSdkInternalVersion>8.0.100-rtm.23506.1</MicrosoftDotnetSdkInternalVersion>
<SdkVersionForWorkloadTesting>$(MicrosoftDotnetSdkInternalVersion)</SdkVersionForWorkloadTesting>
<!-- <SdkVersionForWorkloadTesting>$(MicrosoftDotnetSdkInternalVersion)</SdkVersionForWorkloadTesting> -->
</PropertyGroup>
</Project>
5 changes: 4 additions & 1 deletion src/mono/wasm/testassets/WasmBasicTestApp/LazyLoadingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ public static void Run()
{
// System.Text.Json is marked as lazy loaded in the csproj ("BlazorWebAssemblyLazyLoad"), this method can be called only after the assembly is lazy loaded
// In the test case it is done in the JS before call to this method
var text = JsonSerializer.Serialize(new Person("John", "Doe"));
var text = JsonSerializer.Serialize(new Person("John", "Doe"), SourceGenerationContext.Default.Person);
TestOutput.WriteLine(text);
}

internal partial class SourceGenerationContext : JsonSerializerContext
{
}
public record Person(string FirstName, string LastName);
}

0 comments on commit 768b65b

Please sign in to comment.