Index into arbitrary nested Dictionary/List structure in C# -
i have structure dictionary<string,object>
, values either strings, nested dictionary<string,object>
or lists
of these nested dictionaries. structure temp area build converted json.
if want make assertions on contents of structure, though, can't like
foo["bar"][0]["baz"][1][2]["quux"]
without ridiculous type casting, , because structure not recursive, solution (recursive generic types) doesn't work.
what best option here?
should @ dynamic
? should replace dictionary
instances anonymous objects?
should looked @ expandoobject
? etc.
since converting json anyway use json.net lets foo["bar"][0]["baz"][1][2]["quux"]
out of box , has other nice features turning object in formatted json string once ready turn in that.
Comments
Post a Comment