Skip to content

RetrieveJSONProperty: .NET 10, NUnit 5 constraint model, JsonTypeInfo name lookup - #2332

Merged
vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/103723-csharp-retrieve-json-property-names
Oct 26, 2026
Merged

vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/103723-csharp-retrieve-json-property-names

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the json-csharp/RetrieveJSONProperty sample to net10.0 with Newtonsoft.Json 13.0.4 and NUnit 5.0.0, rewrites the tests with Assert.That, fixes the serialization round trip to deserialize into Dictionary<string, object?> so non-string values no longer throw, and adds GetSerializedPropertyNames, which reads the JSON names from the System.Text.Json contract (JsonTypeInfo), together with a Customer DTO, a fifth menu option and seven new tests.

…JsonTypeInfo name lookup

Retarget both projects to net10.0, update Newtonsoft.Json to 13.0.4 and the
test packages to NUnit 5.0.0, NUnit3TestAdapter 6.3.1, NUnit.Analyzers 4.15.0,
Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0. Move the tests to
Assert.That. Deserialize to Dictionary<string, object?> in the serialization
round trip so non-string values work. Add GetSerializedPropertyNames<T>, the
Customer DTO, menu option 5 and seven tests.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit c0d6f15 into CodeMazeBlog:main Oct 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant