C
C#•11mo ago
Pannekoekje

Serialize value of property only

Given this code: https://dotnetfiddle.net/C3Pt3C How would I only serialize the value of the "TempType" rather than the whole object?
C# Online Compiler | .NET Fiddle
Test your C# code online with .NET Fiddle code editor.
13 Replies
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Pannekoekje
PannekoekjeOP•11mo ago
I should've made the example better
Pannekoekje
PannekoekjeOP•11mo ago
C# Online Compiler | .NET Fiddle
Test your C# code online with .NET Fiddle code editor.
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Pannekoekje
PannekoekjeOP•11mo ago
Sorry
Pannekoekje
PannekoekjeOP•11mo ago
C# Online Compiler | .NET Fiddle
Test your C# code online with .NET Fiddle code editor.
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Pannekoekje
PannekoekjeOP•11mo ago
Why wouldn't I?
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Pannekoekje
PannekoekjeOP•11mo ago
I understand that, but I thought combining the JsonPropertyName + Value of the variable would be possible
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Sir Rufo
Sir Rufo•11mo ago
It can be done with a custom JsonConverter
Pannekoekje
PannekoekjeOP•11mo ago
I'm doing it another way, thx 🙂
Want results from more Discord servers?
Add your server