79653939

Date: 2025-06-05 07:10:29
Score: 0.5
Natty:
Report link

In case that somebody has same variant of the issue as me...

I had JObject instance that I wanted to be converted to instance of Object without keeping the information about original type. The main difference from other answers is, that I do not have any structure of the object - it needs to be variable for any structure.
The solution was to serialize it and then do the deserialization again, but not using Newtonsoft, but using System.Text.Json which created just a plain object instance. Deserialization using Newtonsoft was producing JObject again.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Jarda