I would like to have any ready generic solution to convert string with POST data like :
"id=123&eventName=eventName&site[domain][id]=123"
to my complex object
public class ComplObject {
public int id {get;set;}
public string eventName {get;set;}
public siteClass site{get;set;}
}
public class siteClass {
public domainClass domain {get;set;}
}
public class domainClass {
public int id {get;set;}
}
Access to asp.net MVC reference is allowed. Looks,like i need standalone formdata binder, but i cannot find any work library/code to handle it.
You need to implement your custom http parameter binding by overriding the HttpParameterBinding class. Then create a custom attribute to use it on your web API.
Example with a parameter read from json content :
CustomAttribute:
ParameterBinding :
WepAPi