Thursday, May 23, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
-7
rated 0 times [  0] [ 7]  / answers: 1 / hits: 22708  / 9 Years ago, wed, september 16, 2015, 12:00:00

I'm using Jint to execute JavaScript in a Xamarin app. Jint is converting an associative array into an ExpandoObject. How do I use this object? Ideally, I'd like to get a dictionary of the data out of it.



JavaScript returns:



return {blah:abc, bleh:xyz};


Debugger of Object that Jint returns looks like:



enter


More From » c#

 Answers
13

It already IS a dictionary. Just implicitly cast it:



IDictionary<string, object> dictionary_object = expando_object;


And then use it like one. BTW: this is also the reason why recursive's solution works.


[#65039] Monday, September 14, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jericho

Total Points: 204
Total Questions: 98
Total Answers: 108

Location: Thailand
Member since Thu, Apr 22, 2021
3 Years ago
;