Is it possible to create a generic Mvc controller that catches any simple Json object from a web page post and can then be interrogated for keys/values, eg
public JsonResult SaveData(Dictionary<String, Object> rs)
{
PersonObject obj= new PersonObject();
foreach (string Key in rs.Keys){
if (Key == "name")
obj.Name=rs[Key];
}
}
My web page does something like this :
var obj={"name" : "blah", "age": 38, "gender" : "lady"};
$.post('SaveControler/saveData', obj, function(d){});
I basically don't want to keep constructing custom view models for each entity, just have some generic code for each controller action that can use reflection to populate objects.