I have a dynamic
object that I have to convert to json
(anonymous) for passing to an API as param. What is the best way to do this conversion?
There is this post:
How to convert a dynamic object to JSON string c#?
But this does not quite apply to me as I cannot use var
as explained in the comment below.
Thanks Anand
Trying to covert
dynamic d = new ExpandoObject()
d.prop = "value"
To:
var json = new {prop = "value"}