I have this method:
public ActionResult MyMethod(string email, MyComplexObject json)
When I call it with these parameters I get the error from the title:
{"email":"ppep@p.com","json":{"some big json which consists of many arrays"}}
If I add a parameterless constructor in the MyComplexObject class, the exception doesn’t occur, but json is passed as null. The parameterless constructor is called. How to call the other constructor, not the default one?
What I did was creating a new class which had the same propertieswhich were passed in the big json, and I changed the method:
and it worked.