I am POSTing a JSON object to a controller action:
$.ajax({
url: "/path/to/action",
type: "POST",
dataType: "json",
data: {
name: "John Doe",
phone: "2323454543",
skills: {
code: "php",
design: "photoshop"
}
}
});
How can I map this data to some kind of key-value pair object? In PHP, these get mapped to an associative array invisibly. I would like to be able to access properties like this:
SomeDynamicType data = ...//something here to prepare json data
string codeSkills = data.skills.code; //codeSkills should = "php"
I'm not interested in model binding since these value do not correspond to a model - they are arbitrary.