I need to have method in web api that receives json, but its structure is dynamic. I tried to use following code, but always value is null.
[HttpPost]
public class TestController : Controller
{
public JsonResult DoJob(dynamic value)
{
//Work with parameter
}
}
Used this json
{"testObject":{"property":"value"}, "otherPropery": "otherValue"}
UPDATE: This is how I send request from client side
value is {"testObject":{"property":"value"}, "otherPropery": "otherValue"}
$http.post("test/dojob",value);
Test/DoJoburl?