© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
27 replies
The Fog from Human Resources

Refactoring objects issue

So a long long time ago i implemented Objects and how they are set in a very stupid way, which i am now correcting by adapting them to be compatible with the default JSON Serializer and bringing the code to overall more structure by following C# conventions more

My issue

I want to structure the following object (shown in the screenshot) to use [JsonPropertyName] and such instead of the constructor with a JObject (from Newtonsoft JSON), which would be no problem, however, as you can see some values use a different key (for example ndcId is in "o":{"ndcId":0000}) while others are more nested (like "o":{"chatmessage":{"content"}})
What would be the proper approach to serialize them with the default serializer while keeping them in the same class as i dont want to split up my class for every branch of "o"
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Refactoring if else
C#CC# / help
4y ago
Refactoring provider crashes
C#CC# / help
4y ago
Refactoring Similar Network Requests
C#CC# / help
16mo ago