Skip to content

Serialize a Dictionary to JSON: port to .NET 10 and add a key converter - #2329

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/87115-csharp-how-to-serialize-a-dictionary-to-json
Oct 29, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/87115-csharp-how-to-serialize-a-dictionary-to-json

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the JsonSerializeDictionary sample from net7.0 to net10.0, updates Newtonsoft.Json to 13.0.4 and the test packages (xunit 2.9.3, xunit.runner.visualstudio 4.0.1, Microsoft.NET.Test.Sdk 18.11.0, coverlet.collector 10.1.0, Bogus 35.6.5, NJsonSchema 11.6.1), adds a CustomerKeyConverter that overrides WriteAsPropertyName with two tests, and adds the key converter, Guid key projection and DictionaryKeyPolicy examples to Program.cs. Helper.cs stays where it was.

…erter

Retarget all three projects to net10.0, bump Newtonsoft.Json to 13.0.4 and the test packages, add CustomerKeyConverter (WriteAsPropertyName) with two tests, and add the key converter, Guid key projection and DictionaryKeyPolicy examples to Program.cs.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit 09b5cb6 into CodeMazeBlog:main Oct 29, 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