Accessing nameless attributes from JSON in VB .Net using DataContract -
i'm trying serialize in vb .net json file contains this: "scripts": [[123, 80, [["whenkeypressed", "space"], ["nextcostume"]]], [55, 32, [["whenkeypressed", "space"], ["doplaysoundandwait", "hello"]]]]
i'm using datacontract
, <datamember(name:="scripts")>
, works fine rest of file, in case, attributes don't have names. jsonlint.com
, json validator, saying valid json.
how suppose qualify datamembers? also, has nameless array in it, how can can access it?
any appreciated.
i found workaround assigning scripts
list(of object)
in datacontract
, casting scripts
desired type @ runtime. casted ilist(of object)
lists , iterated in them for
loops.
it doesn't "feel" "object-oriented" rest , can't reference fields name (since have none), works (with lot of casting, since work option strict on
).
if there better way, open suggestions.
Comments
Post a Comment