Tag Archives: ExpandoObject

C# Convert XML to JSON using dynamic ExpandoObject, XDocument and NewtonSoft.JSON

So I receive these XML feeds from my client, but I need to enrich the contents before I can use the data. AND I would like to work with JSON instead. So how to do that with a few lines … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , , , , , | Leave a comment

C# Deserialize JSON to dynamic ExpandoObject()

The Microsoft System.Text.Json.Serialization.JsonSerializer cannot (yet) convert JSON into dynamic objects. But good ole Newtonsoft.Json can. The conversion is simple too: After the conversion, you can work with the dynamic object as you wish: MORE TO READ: How to serialize and … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , | 1 Comment

Creating dynamic arrays and lists using Dynamic and ExpandoObject in C#

In this previous post, C# Using Newtonsoft and dynamic ExpandoObject to convert one Json to another, I described how you can use the dynamic keyword and the ExpandoObject class to quickly transform JSON without the need for any concrete implementations of … Continue reading

Posted in .net, c#, General .NET | Tagged , , , | 3 Comments

C# Using Newtonsoft and dynamic ExpandoObject to convert one Json to another

The scenario where you convert one input Json format to another output Json is not uncommon. Before C# dynamic and ExpandoObject you would serialize the input Json to POCO model classes and use a Factory class to convert to another … Continue reading

Posted in c#, General .NET | Tagged , , , | 4 Comments