Skip to main content
added 185 characters in body
Source Link
t3chb0t
  • 44.3k
  • 9
  • 84
  • 190

The root of the problem lies in this line:

dynamic expando = /* ParseConfigToJsonWithoutNulls -> ParseJsonToExpandoObject */

where you decided to parse json*.json files into an ExpandoObject and not directly into a Dictionary or some other strong type.

I bet you are using jsonJson.netNet for the job and there are countless possibilities to deserialize jsonJSON in such a way that ExpandoObject is not necessary.

The properThis means that the conversion should take place during deserialization and not after that.


I suggest posting another question where you show us how you read your *.json. Maybe then we can help you to get rid of the ExpandoObject altogether.

The root of the problem lies in this line:

dynamic expando = /* ParseConfigToJsonWithoutNulls -> ParseJsonToExpandoObject */

where you decided to parse json into an ExpandoObject and not directly into a Dictionary or some other strong type.

I bet you are using json.net for the job and there are countless possibilities to deserialize json in such a way that ExpandoObject is not necessary.

The proper conversion should take place during deserialization and not after that.

The root of the problem lies in this line:

dynamic expando = /* ParseConfigToJsonWithoutNulls -> ParseJsonToExpandoObject */

where you decided to parse *.json files into an ExpandoObject and not directly into a Dictionary or some other strong type.

I bet you are using Json.Net for the job and there are countless possibilities to deserialize JSON in such a way that ExpandoObject is not necessary.

This means that the conversion should take place during deserialization and not after that.


I suggest posting another question where you show us how you read your *.json. Maybe then we can help you to get rid of the ExpandoObject altogether.

Source Link
t3chb0t
  • 44.3k
  • 9
  • 84
  • 190

The root of the problem lies in this line:

dynamic expando = /* ParseConfigToJsonWithoutNulls -> ParseJsonToExpandoObject */

where you decided to parse json into an ExpandoObject and not directly into a Dictionary or some other strong type.

I bet you are using json.net for the job and there are countless possibilities to deserialize json in such a way that ExpandoObject is not necessary.

The proper conversion should take place during deserialization and not after that.