With a subclass of ApiController, it has the ability in the Post method to bind it to an existing model object, for example
public class RegisterController : ApiController
{
public void Post(Product product)
but if the input JSON data contains data that I will use to create several model objects, how can I directly get the data?
public void Post(dynamic value)
returns value as null. Is there an easy shortcut way to get to it, like request.POST ['name'] or something else?
Say the data looks like
{
'productID':1,
'productName':'hello',
'manufacturerID':1,
'manufacturerName':'world'
}
xster source
share