c# - Parse JSON block with dynamic variables -
i'm grabbing json object url , parsing json.net. able parse blocks of data defined variables fine, when comes random collection of var:value - i'm stuck.
example(loosely typed):
{"fname":"joe","lname":"doe",
"bodytype":{"height":180,"weight":"200","race":"white","hair":"black"},
"belongings":{"shirt":"black","money":15,"randomthing":"anyvar"},
"signs":{"tattoo":0,"scar":"forehead","glasses":"dorky"}
}
i'm casting to
class person how handle belongings , signs if cannot predict properties?
{
public string fname;
public string lname;
public bodytype bodytype;
public ????? belongings;
public ????? signs;
}
well, they're sure json objects, right, , json objects associative arrays mapping strings something. i'd represent them dictionary<string, dynamic> -- map of strings somethings.
Comments
Post a Comment